Make sure conda is installed and in your PATH open the terminal client. Type conda -V at the command prompt on the terminal and press enter. If conda is installed, you should see something like the following.
Konda -V
conda 3.7.0 2. Check the relevance of conda In the terminal client, enter
conda update conda
Update all packages, if necessary, by typing y to continue. 3. Create a virtual environment for your project. In the terminal client, enter the following, where yourenvname is the name you want to call your environment, and replace the xx version of Python that you want to use. (To first see a list of available versions of Python, enter
conda search "^python$" and press enter.) conda create -n yourenvname python=xx anaconda
Press y to continue. This will install the Python version and all associated anaconda packaged libraries at path_to_your_anaconda_location / anaconda / envs / yourenvname. 4. Activate the virtual environment. To activate or switch to your virtual environment, simply enter the following, where yourenvname is the name you gave your environment when you created it.
source activate yourenvname
Enabling conda changes the PATH and shell variables, pointing to the particular Python isolated sandbox you created. The command line will change to indicate which environment you are in by adding (yourenvname). To see a list of all your environments, use the conda info -e command. 5. Install additional Python packages in a virtual environment. To install additional packages only in your virtual environment, enter the following command, where yourenvname is the name of your environemnt and [package] is the name of the package you want to install. Failure to specify "-n yourenvname" will install the package in the Python root installation.
conda install -n yourenvname [package]
Deactivate your virtual environment. To end a session in the current environment, enter the following: There is no need to specify the name envname, which is ever active at the moment, will be deactivated, and the PATH and shell variables will be returned to normal.
deactivate source
Remove the unnecessary virtual environment. To remove the conda environment, enter the following, where yourenvname is the name of the environment you want to delete.
Konda remove -n yourenvname --all
Codingkido Mar 19 '18 at 3:51 2018-03-19 03:51
source share