Installing Anaconda and Conda in Ubuntu 18.04
1. Download the latest version of Anaconda regarding your preferred Python version from:
2. Type in terminal:
$ bash ~/Downloads/Anaconda3-5.3.0-Linux-x86_64.sh #for python3.*
$ bash ~/Downloads/Anaconda2-5.3.0-Linux-x86_64.sh #for python2.*
* Be aware of the latest version of Anaconda (e.g. here is 5.3.0)
* More information can be found at the official website.
3. Follow the instructions and finalise the installation through the terminal (y/n).
4. At the end, it asks about installation of VS Code. You may say ‘yes’ as you wish.
Installing VS Code for Python
5. Install VS Code through Ubuntu Software Center or from the official website.
* If you download from official website, you may insert in terminal:
$ sudo dpkg -i ~/path/to/code_1.30.2-1546901646_amd64.deb
* More information at https://code.visualstudio.com/docs/setup/linux
6. Set the active environment:
Ctrl+Shift+P > type:
Python: S > find from the list: Python: Select Interpreter > then select the proper interpreter. Ex. Anaconda Python 3.x
* More information at https://code.visualstudio.com/docs/python/environments
7. Install basic extension of Python to ease your coding (e.g. beautiful theme, pylint, Python for VS Code).
Create Virtual environment for your python
The virtual env would helps you to install the required modules on a specific version of Python (e.g. 2.x or 3.x).
You can simply create a virtual environment by ‘conda’. First make sure your conda path is correctly defined by:
$ export PATH=~/anaconda2/bin:$PATH #for anaconda 2
$ export PATH=~/anaconda3/bin:$PATH #for anaconda 3
Then create your env by:
$ conda create -n yourenvname python=x.x anaconda
Finally enter to your environment by typing:
$ source activate yourenvname
You can check the version in ‘yourenvname’ of your Python by:
$ python --version