Learning Python (X) - the basic commands conda

Note that this command are measured using the Anaconda Prompt, not cmd command line is not recommended to use the latter.

Information Display

  • info Conda
    Conda detailed information
    Here Insert Picture Description
    note, the above figure python version does not refer to the current environment python version, but the version of the base environment, want to see the current environment python version, python --version can direct (conda can also enter the command line Python).
  • conda -V
    Displays the current conda version, you can also use conda --version
    Here Insert Picture Description
  • conda list
    view under the current environment of all installed packages
    Here Insert Picture Description
  • conda env list
    displays all current environmental information conda has been created:
    Here Insert Picture Description
    BTW, next Anaconda Prompt, every front-line command will prompt name of the current environment, conda env list will be marked with an asterisk current environment:
    Here Insert Picture Description

Python environmental management

  • Creation Environment
conda create -n NAME python=3.5

NAME is the name of the custom of the environment, on both sides of the equal sign without spaces
practical operation:
Here Insert Picture Description
Success:
Here Insert Picture Description

  • Switching environment
conda activate NAME

Here Insert Picture Description

  • Exit the environment
conda deactivate

Here Insert Picture Description
conda deactivate will be returned to the base environment

  • Delete the environment
conda remove -n NAME --all

Here Insert Picture Description
After the operation is over:
Here Insert Picture Description

conda Management Pack

  • View all packages
conda list

Here Insert Picture Description

  • Installation package
conda install PACKAGE_NAME

Of course, you can also install a specific version of the package:

conda install PACKAGE_NAME=version_no    # version_no是版本号,只有一个等号
  • Upgrade package
conda update PACKAGE_NAME
  • Delete Package
python remove PACKAGE_NAME

pip and conda command comparison

command pip conda
View package pip list Conda list
installation pip install package_name conda install package_name
Installation (specific version) pip install package_name==ver_no conda install package_name=ver_no
upgrade pip install --upgrade package_name conda update package_name
delete pip uninstall package_name conda remove package_name

The following points are noteworthy:

  • pip will download the specified package, conda will download the specified package dependencies, accordingly, will be deleted when you delete conda corresponding dependencies
  • When the version number of the specified install, pip by "==", conda by "="
  • When you upgrade, pip use install --upgrade, conda using update
  • When delete, pip use pip uninstall, conda use pip remove

About pip basic introduction to see my other article: use pip install the package
on the difference between pip and conda, you can see my other article: Python, pip, conda and Anaconda

Department of the original article, please indicate the source. Inadequate welcome comment explore, like you can point a praise oh.

Published 149 original articles · won praise 25 · views 10000 +

Guess you like

Origin blog.csdn.net/ProLayman/article/details/104298864