Oct-28-2017, 06:16 AM
This will mainly be about Anaconda and some other ways to run Python.
When i mention OS Python is from Python.org and tutorial for Windows part-1, part-2 and Linux part-1.
Anaconda(1,000 packages+), Miniconda(without packages)
Anaconda,Miniconda is stand alone Python distribution for Windows,Linux and Mac OS X.
It do not mess with OS Python,so no problem to have both installed.
Conda is there package manager,like pip is for OS Python.
Installation Windows
Under install can choose path where to install i have it on
a drive i have good space on,full Anaconda is about
Under install get question about add Anaconda to Path(work anywhere from
If want OS Python to be in Path mark of.
The navigator:
[Image: ieRhfa.jpg]
[Image: RJrtS9.jpg]
One the strong point is that get a lot ready to use like Jupyter NoteBook and Spyder Editor.
Conda and pip
Conda and pip is placed in
Version and Python:
...
Install example using Miniconda:
Conda is a strong installer and find most packages,
pip has also got a lot better with Python 3.6,but still there are sometime has to go to Gohlke(to get wheel eg scipy for OS Python).
Always use
Virtual environment with Anaconda
Create a virtual environment with specific packages of choice scipy,pandas,requests.
Environment can also be shared with with someone else bye exported a
Conda Forge
Will cross-platform testing(Windows,Linux and OSX) before they distribute the package.
This way a package will work the same on all OS and environment.
Using conda-forge:
Linux
For Linux will be using pyenv to install Anaconda/Miniconda.
pyenv make it easy to install and change between versions tutorial.
Look at version available:
Use Miniconda in shell session:
Other distribution ways and to run Python
To be continued...
When i mention OS Python is from Python.org and tutorial for Windows part-1, part-2 and Linux part-1.
Anaconda(1,000 packages+), Miniconda(without packages)
Anaconda,Miniconda is stand alone Python distribution for Windows,Linux and Mac OS X.
It do not mess with OS Python,so no problem to have both installed.
Conda is there package manager,like pip is for OS Python.
Installation Windows
Under install can choose path where to install i have it on
G:\Anaconda3
,a drive i have good space on,full Anaconda is about
2GB
and 300mb
for Miniconda.Under install get question about add Anaconda to Path(work anywhere from
cmd
),if Anaconda is only Python on OS mark on.If want OS Python to be in Path mark of.
The navigator:
[Image: ieRhfa.jpg]
[Image: RJrtS9.jpg]
One the strong point is that get a lot ready to use like Jupyter NoteBook and Spyder Editor.
Conda and pip
Conda and pip is placed in
G:\Anaconda3\Scripts
if use from cmd/cmder or use Anaconda Prompt.Version and Python:
G:\Anaconda3\Scripts λ conda -V conda 4.3.30 G:\Anaconda3\Scripts λ pip -V pip 9.0.1 from G:\Anaconda3\lib\site-packages (python 3.6) # Python is in root folder G:\Anaconda3 λ python Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> exit() G:\Anaconda3 λUpdate example:
G:\Anaconda3\Scripts λ conda update scipy Fetching package metadata ............. Solving package specifications: . Package plan for installation in environment G:\Anaconda3: The following NEW packages will be INSTALLED: icc_rt: 2017.0.4-h97af966_0 imageio: 2.2.0-py36had6c2d2_0 intel-openmp: 2018.0.0-hcd89f80_7 The following packages will be UPDATED: astropy: 1.3.2-np112py36_0 --> 2.0.2-py36h06391c4_4 h5py: 2.7.0-np112py36_0 --> 2.7.0-np111py36_0 mkl: 2017.0.1-0 --> 2018.0.0-h36b65af_4 numba: 0.33.0-np112py36_0 --> 0.33.0-np111py36_0 numexpr: 2.6.2-np112py36_0 --> 2.6.2-py36h7ca04dc_1 pandas: 0.20.1-np112py36_0 --> 0.20.3-py36hce827b7_2 pytables: 3.2.2-np112py36_4 --> 3.2.2-np111py36_4 scikit-image: 0.13.0-np112py36_0 --> 0.13.0-py36h6dffa3f_1 scikit-learn: 0.18.1-np112py36_1 --> 0.19.1-py36h53aea1b_0 scipy: 0.19.0-np112py36_0 --> 0.19.1-py36h7565378_3 The following packages will be SUPERSEDED by a higher-priority channel: bottleneck: 1.2.1-np112py36_0 --> 1.2.1-py36hd119dfa_0 numpy: 1.12.1-py36_0 --> 1.11.3-py36hb60be0b_3 pywavelets: 0.5.2-np112py36_0 --> 0.5.2-py36hc649158_0 statsmodels: 0.8.0-np112py36_0 --> 0.8.0-py36h6189b4c_0 Proceed ([y]/n)? y icc_rt-2017.0. 100% |###############################| Time: 0:00:02 3.10 MB/s intel-openmp-2 100% |###############################| Time: 0:00:00 3.12 MB/s mkl-2018.0.0-h 100% |###############################| Time: 0:00:47 3.17 MB/s numpy-1.11.3-p 100% |###############################| Time: 0:00:01 3.13 MB/s bottleneck-1.2 100% |###############################| Time: 0:00:00 3.03 MB/s numba-0.33.0-n 100% |###############################| Time: 0:00:00 3.12 MB/s numexpr-2.6.2- 100% |###############################| Time: 0:00:00 3.36 MB/s pywavelets-0.5 100% |###############################| Time: 0:00:01 3.11 MB/s scipy-0.19.1-p 100% |###############################| Time: 0:00:04 3.14 MB/s astropy-2.0.2- 100% |###############################| Time: 0:00:02 3.12 MB/s h5py-2.7.0-np1 100% |###############################| Time: 0:00:00 3.10 MB/s pandas-0.20.3- 100% |###############################| Time: 0:00:02 3.15 MB/s pytables-3.2.2 100% |###############################| Time: 0:00:00 3.12 MB/s scikit-learn-0 100% |###############################| Time: 0:00:01 3.16 MB/s statsmodels-0. 100% |###############################| Time: 0:00:02 3.12 MB/s imageio-2.2.0- 100% |###############################| Time: 0:00:01 3.15 MB/s scikit-image-0 100% |###############################| Time: 0:00:07 3.14 MB/s G:\Anaconda3\Scripts λ
Install example using Miniconda:
G:\Miniconda3\Scripts λ conda install pandas matplotlib Fetching package metadata ............. Solving package specifications: . Package plan for installation in environment G:\Miniconda3: The following NEW packages will be INSTALLED: cycler: 0.10.0-py36h009560c_0 freetype: 2.8-vc14h17c9bdf_0 [vc14] icc_rt: 2017.0.4-h97af966_0 icu: 58.2-vc14hc45fdbb_0 [vc14] intel-openmp: 2018.0.0-hcd89f80_7 jpeg: 9b-vc14h4d7706e_1 [vc14] libpng: 1.6.32-vc14h5163883_3 [vc14] matplotlib: 2.1.0-py36h11b4b9c_0 mkl: 2018.0.0-h36b65af_4 numpy: 1.13.3-py36ha320f96_0 pandas: 0.20.3-py36hce827b7_2 pyqt: 5.6.0-py36hb5ed885_5 python-dateutil: 2.6.1-py36h509ddcb_1 pytz: 2017.2-py36h05d413f_1 qt: 5.6.2-vc14h6f8c307_12 [vc14] sip: 4.18.1-py36h9c25514_2 sqlite: 3.20.1-vc14h7ce8c62_1 [vc14] tornado: 4.5.2-py36h57f6048_0 zlib: 1.2.11-vc14h1cdd9ab_1 [vc14] The following packages will be UPDATED: conda: 4.3.27-py36hcbae3bd_0 --> 4.3.30-py36h7e176b0_0 Proceed ([y]/n)? y icc_rt-2017.0. 100% |###############################| Time: 0:00:02 3.10 MB/s intel-openmp-2 100% |###############################| Time: 0:00:00 3.11 MB/s mkl-2018.0.0-h 100% |###############################| Time: 0:00:48 3.17 MB/s icu-58.2-vc14h 100% |###############################| Time: 0:00:07 3.14 MB/s jpeg-9b-vc14h4 100% |###############################| Time: 0:00:00 3.07 MB/s sqlite-3.20.1- 100% |###############################| Time: 0:00:00 3.14 MB/s zlib-1.2.11-vc 100% |###############################| Time: 0:00:00 3.50 MB/s libpng-1.6.32- 100% |###############################| Time: 0:00:00 3.16 MB/s numpy-1.13.3-p 100% |###############################| Time: 0:00:01 3.15 MB/s pytz-2017.2-py 100% |###############################| Time: 0:00:00 3.11 MB/s sip-4.18.1-py3 100% |###############################| Time: 0:00:00 3.14 MB/s tornado-4.5.2- 100% |###############################| Time: 0:00:00 3.18 MB/s cycler-0.10.0- 100% |###############################| Time: 0:00:00 7.00 MB/s freetype-2.8-v 100% |###############################| Time: 0:00:00 3.22 MB/s python-dateuti 100% |###############################| Time: 0:00:00 3.28 MB/s qt-5.6.2-vc14h 100% |###############################| Time: 0:00:18 3.16 MB/s pandas-0.20.3- 100% |###############################| Time: 0:00:02 3.11 MB/s pyqt-5.6.0-py3 100% |###############################| Time: 0:00:01 3.15 MB/s matplotlib-2.1 100% |###############################| Time: 0:00:02 3.13 MB/s conda-4.3.30-p 100% |###############################| Time: 0:00:00 3.09 MB/s G:\Miniconda3\Scripts λ
pip has also got a lot better with Python 3.6,but still there are sometime has to go to Gohlke(to get wheel eg scipy for OS Python).
Always use
conda install <package>
first,if not find package use pip install <package>
.Virtual environment with Anaconda
Create a virtual environment with specific packages of choice scipy,pandas,requests.
conda create -n myenv scipy pandas requestsIn that environment can use both conda and pip to install into it.
Environment can also be shared with with someone else bye exported a
.yml
file.conda env export > environment.ymlExample of .yml file:
name: myenv dependencies: - python=3.6 #or eg 2.7 - scipy - pandas - requestsSo can make stand alone packages for someone else to use.
Conda Forge
Will cross-platform testing(Windows,Linux and OSX) before they distribute the package.
This way a package will work the same on all OS and environment.
Using conda-forge:
G:\Miniconda3\Scripts # This will activate conda-forge λconda config --add channels conda-forge # Then is normal install λ conda install scipy Fetching package metadata ............... Solving package specifications: . Package plan for installation in environment G:\Miniconda3: The following NEW packages will be INSTALLED: scipy: 0.19.1-py36h7565378_3 The following packages will be SUPERSEDED by a higher-priority channel: conda: 4.3.30-py36h7e176b0_0 --> 4.3.29-py36_0 conda-forge conda-env: 2.6.0-h36134e3_1 --> 2.6.0-0 conda-forge Proceed ([y]/n)? y conda-env-2.6. 100% |###############################| Time: 0:00:00 352.37 kB/s scipy-0.19.1-p 100% |###############################| Time: 0:00:04 3.12 MB/s conda-4.3.29-p 100% |###############################| Time: 0:00:01 469.44 kB/s G:\Miniconda3\Scripts λ
Linux
For Linux will be using pyenv to install Anaconda/Miniconda.
pyenv make it easy to install and change between versions tutorial.
Look at version available:
mint@mint ~ $ pyenv install --list anaconda3-4.3.1 anaconda3-4.4.0 anaconda3-5.0.0 miniconda3-4.3.14 miniconda3-4.3.21 miniconda3-4.3.27Install:
mint@mint ~ $ pyenv install miniconda3-4.3.27 Downloading Miniconda3-4.3.27.1-Linux-x86_64.sh... -> https://repo.continuum.io/miniconda/Miniconda3-4.3.27.1-Linux-x86_64.sh Installing Miniconda3-4.3.27.1-Linux-x86_64... Fetching package metadata ........... Solving package specifications: . Package plan for installation in environment /home/mint/.pyenv/versions/miniconda3-4.3.27: The following packages will be UPDATED: conda: 4.3.27-py36h2866c0b_0 --> 4.3.30-py36h5d9f9f4_0 pip: 9.0.1-py36h30f8307_2 --> 9.0.1-py36h8ec8b28_3 pip-9.0.1-py36 100% |###############################################################################################| Time: 0:00:00 3.16 MB/s conda-4.3.30-p 100% |###############################################################################################| Time: 0:00:00 3.24 MB/s Installed Miniconda3-4.3.27.1-Linux-x86_64 to /home/mint/.pyenv/versions/miniconda3-4.3.27
mint@mint ~ $ pyenv shell miniconda3-4.3.27 (miniconda3-4.3.27) mint@mint ~ $ conda install jupyter (miniconda3-4.3.27) mint@mint ~ $ jupyter notebook
Other distribution ways and to run Python
To be continued...