Hello Dear Programmers,
In this blog, I will be explaining step by step, how you can setup, create, and use Conda Virtual Environments on any Ubuntu machine.
Step 1: Installing Conda
Follow below steps to download and install conda:
- Open Terminal
- Run 'sudo apt-get update'
- Run 'sudo apt-get install curl'
- Open https://www.anaconda.com/products/individual in a browser, scroll to the bottom, and copy link of the highlighted version as shown in the below image:
- In Terminal, run 'curl –O https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh'. Replace the link with the copied one from the previous step.
- Run 'bash Anaconda3-2021.11-Linux-x86_64.sh'. Replace the file name with file downloaded in the previous step. Press 'Enter' or type 'Yes' if asked in the terminal. This will complete the installation process.
Step 2: Create Conda Virtual Environment
- Open new Terminal, and run 'source ~/.bashrc'.
- Run 'conda create ––name py37 python=3.7'. You can give your custom environment name instead of py37, and specify which python version to use. This will create a conda virtual environment.
- To see list of conda enironments, you can run 'conda env list'.
Step 3: Activate and Deactivate Conda Virtual Environment
- To activate, run 'conda activate py37'. Give your environment name instead of py37.
- To deactivate, run 'conda deactivate'.
If you liked the content, kindly leave your valuable comments.
Thanks and Happy Coding! :)
Buy Me a Coffee - https://www.buymeacoffee.com/agautam