Install Anaconda on Linux – Last post we saw how to install Anaconda in Linux.
Now lets see how to create multiple python versions on same machine using Anaconda and using them with any compatibility issues.
Creating a new python version:
- conda create –name <> python=<>
- E.g : conda create –name py36 python=3.6
Using particular Python version:
There are multiple ways you can use the desired python versions.
- source activate <>
- This activates the desired python env and you can install any python packages which reflects only for the activated version.
- Also any python code you execute will use the activated version.
- To exit this virtual env, type : source deactivate <>
- You can invoke directly from installed directory like below:
- /opt/anaconda/py36/bin/python – (This invokes python 3.6)
- Add to PATH environmental variable and add inn bashrc:
- export PATH=/opt/anaconda/py36/bin:$PATH
- After adding to bashrc, type : source ~/.bashrc
List Installed Python Versions:
Download Link : https://repo.continuum.io/archive/Anaconda2-4.3.1-Linux-x86_64.sh
- Download the appropriate installer in the above links
- Execute the following bash Anaconda<<version>>-Linux-x86_64.sh
- Follow the instructions and complete the installation process
Testing Anaconda installation
Alright, we are done with the installation of Anaconda, let’s see how to verify that it is working as desired, run following command on your terminal and it should show output as list.
You can update the installed conda / anaconda packages by using following command.
In order to uninstall Anaconda, you need to remove its installation directory completely.