This is SEIYA (@ SeiyaSunapro7th). I have summarized the command lines that are useful when using a virtual environment (conda environment) using Anaconda.
macOS Catalina ver.10.17.7 conda ver.4.8.5
$ conda info
$ conda update conda
Commands for building a conda environment. Specify the package to be added when building the conda environment. If you do not specify the version, the latest version will be installed.
$ conda create -n Environment name Add package
When installing python3.7 and numpy in ex. conda environment
$ conda create -n environment name python=3.7 numpy
Install the library that conda supports in the built conda environment.
$conda install library name
On the contrary, the command to uninstall.
$conda uninstall library name
Update the specified library.
$conda update library name
$conda activate environment name
$ conda deactivate
$ conda remove -n Environment name –all
Outputs all environments (including base environment) in Anaconda.
$ conda info -e
Output the library installed in the specified environment. If you want to specify it, output the information of the working environment.
$ conda list -n Environment name
Output the library corresponding to conda. It also outputs the library and the corresponding python version.
$ conda search (--full-name)Library name
If it doesn't support conda, you can install it with conda by doing the following. If there are several libraries, output the library you want to install and decide which one to use.
$ anaconda search -t conda library name
Find out the details of the package you want to install and find the URL used for install.
$anaconda show package name
ex. If you want to install pygame
$ anaconda show CogSci/pygame
Install the package from the specified URL.
$ conda install -c Searched URL Package name
If you install the Python library without checking the dependencies, it may cause a malfunction. (Be careful when using pip) You can keep the execution environment as clean as possible by using the virtual environment.
Recommended Posts