Conda / Miniconda / Anaconda finishing commonly used commands and reports, get a text

Author: HELO Source: http: //www.cnblogs.com/HELO-K welcome to reprint, please retain this statement when reproduced, thank you!

 

Here compile a full point Conda commonly used commands, we refer convenient for everyday use, some commands also added some more detail for beginners, Gangster please ignore.

This article will continue to update, remember to use the search page to find the command you want Oh, yes,  the page at the end of a row of three consecutive strike seems you can select the current line, easy to copy.

If you find errors, please point out, I will modify as soon as possible.


 # View conda basic information

# View conda version information 
conda info 
# conda updated version 
conda Update -n Base conda

 

# Conda environment-related

New Environment # 
# Create a python named version 3.6 of ENVNAME 
Conda Create --name ENVNAME python = 3.6 
# here --name may be abbreviated - n-, so the following more general usage, the same abbreviations will be used hereinafter, this see all abbreviations Conda the create -n ENVNAME Python = 3.6 # install some packages can also be created at the same time environment, you can also specify the version of the package, such as Conda the create -n ENVNAME Python = 3.7 numpy = 1.16 . 4 matplotlib

 

# Activate / switching environment

# Activate named ENVNAME environment 
Conda of an activate ENVNAME 
# environment-specific activation of the path, the author Note: This command occasionally with Conda of an activate
/ path / to / Environment- dir
# close the current environment, the authors note: If you do not continue to use the command line window, close the window directly to the static # behind closed environment does not need to specify the name of the environment, the default close the current environment Conda deactivate
# List all environmental Conda
env List

 

# Package management related

# List the current environment all installed packages 
Conda List 
# List all packages specified environment Conda List
- the n-ENVNAME
# listed in the current version of the package historic environment management changes (this version of the record is similar to git's record, record every time you environmental management operations after the package
!! records, rather than the version of the package record) # author note: this feature can be life-saving critical time, say you hand cheap upgrade an environment, there are problems want to roll back to the previous environment when the state Conda List - Revisions
# ditto, listed package management changes in the environment specified version history Conda List
--name ENVNAME - Revisions
# combination of the above two commands used to list all versions through the above command, then by the following command will retreat to a version Conda
install -n ENVNAME - Revision REV_NUMBER
# remove an environment, there is a more violent way is to directly delete envs under the anaconda installation path
/ ENVNAME folder Conda the Remove -n ENVNAME - -all

 

# Share relevant environment

# Copy the specified environmental 
Conda Create --clone ENVNAME - name NEWENV 
# YAML export file to the specified environment (to facilitate introducing the same to restore environment on another computer) Conda
the env Export --name ENVNAME> envname.yml
# from YAML file creation environment Conda
env the create - file envname.yml
# If there environment.yml files in the current directory, enter the file name does not directly create the environment, as follows: Conda
env the create
# export the current environment package version of the list Conda list
--explicit > pkgs.txt
# or use the command to export a simpler package list below Conda list
-e> pkgs.txt

# creation environment based on the package versions list
conda create --name NEWENV --file pkgs.txt

 

# Packages (package), and Channels (source / channel) to be used

# Add Channels 
Conda config - the Add CHANNELNAME channels 
# Conda from Channels use the configured search packet, you can bring a version number, author Note: with less, the graphical interface systems may be directly Baidu / google search a little more convenient Search numpy Conda
= 1.16
# channels using anaconda from all the search packet anaconda Search FUZZYNAME
# installation package from a specified channel, as Conda
the install conda- Forge PKGNAME ::
# install the specified version of the package, a neutral, or may be two equal sign Conda
install PKGNAME == 3.1 . 4
# uninstall the current environment of a package Conda uninstall PKGNAME
# uninstall a package designated environment Conda uninstall
- the n-ENVNAME PKGNAME
all packages # upgrade the environment, can also be specified environment
!! command parameters regardless order conda update--all --n ENVNAME

 

# Other useful commands

When coupled with # search package - info , you can output the packet details 
Conda Search PKGNAME - info 

Case # clean up unused cache and packages can sometimes easy to clean up a few G, but if it is not particularly limited hard disk space , it is recommended not to clean up, because the installation package if the cache has this package do not have to re-download the Conda Clean - All
# installation package and the output command prompt, which is the direct installation does not require confirmation, it will be useful to write a script to run automatically when conda
install - yes PKG1 PKG2
# conda output configuration conda config
--show

 

Reference #

This article made reference to a large number of Conda official English version of CheatSheet 
[Conda Cheat Sheet] (https://conda.io/projects/conda/en/latest/user-guide/cheatsheet.html)
[Conda cheatsheet] (HTTPS: // GIST .github.com / qheuristics / 8943338)

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/HELO-K/p/11519988.html