Comprehensive conda instructions (create/info/init/install/list/package/remove/rename/run/search/update/notices)

Table of contents

Different Ways to Open a Command Line Execution Window

cmd

powershell (terminal)

terminal inside pycharm

Anaconda Prompt

view help

view version

View all virtual environments

Activate the environment

close environment

command encyclopedia

clean clean up

view help

Clean up useless installation packages

Clean up the tarball

Clean up all installation packages and cache

compare

view help

config

view help

View configuration information (method 1)

view source

add source

delete source

Show package source

Change (add, delete) the virtual environment default installation path

create

view help

create environment

clone environment

info

View configuration information (method 2)

view help

init

view help

install

view help

list

view help

List all packages in the current environment

List all packages installed into environment "robot"

Use "^" to list all packages starting with the letter "p"

Export installed packages as files

Reinstall package from export file

package

view help

remove

view help

delete environment

view help

run

view help

search

view help

example

update(upgrate)

view help

upgrade conda

Upgrade anaconda (need to upgrade conda first)

upgrade spyder

notices

view help


Different Ways to Open a Command Line Execution Window

cmd

win+R to open "Run", enter cmd

powershell (terminal)

win+R to open "Run", enter powershell

(or right-click the "Start" icon and click Terminal)

terminal inside pycharm

Error: Unable to load file profile.ps1

The file D:\Users\Lenovo\Documents\WindowsPowerShell\profile.ps1 could not be loaded because running scripts is prohibited on this system.

Could not load file E:\Software\anaconda3\shell\condabin\Conda.psm1 because running scripts is prohibited on this system.

65e6085fcfdc47c7b1d4334114cbef65.png

Reason: In Windows system, the execution of .ps1 files is not allowed by default

Solution:

Open a terminal with administrator privileges and enter

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

You can use Get-ExecutionPolicy to confirm whether the modification is successful

122bf48617aa427b858ed2f3626e4c15.png

After successful modification

07b91b45c2744bfb9969d911cafe2213.png

Anaconda Prompt

view help

conda

conda -h

conda –-help

0c8c153c6073469683a11f6366c545e6.png

view version

conda -V

conda –-version

View all virtual environments

conda env list

conda info -e

conda info --envs

42f7dd629c2f45d2a1cdd1f9c3b1d95f.png

Activate the environment

conda activate robot

activate robot              # cmd中可以省略conda

edd0e551fa7e482886914a9c74560215.png

 7f962faac5a84392ba6aa20ea09bb486.png

close environment

conda deactivate

7e1d9c3c39d94954945d3205c934292b.png

command encyclopedia

clean clean up

view help

conda clean -h

740aa8276f3a4d59878af241238752e8.png

Clean up useless installation packages

conda clean -p

Clean up the tarball

conda clean -t

Clean up all installation packages and cache

conda clean -y --all

compare

view help

conda compare -h

2964c66313224144a54cf2878ab701d9.png

config

view help

b41cb6f094294204a6cc0033793d4e34.png

View configuration information (method 1)

conda config –show

view source

conda config --show-sources

d78bd7d7ffbf45508e3d140656f2bdec.png

add source

conda config --remove channels + sources to add

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

delete source

conda config --remove channels + source to remove

Show package source

conda config --set show_channel_urls yes

Change (add, delete) the virtual environment default installation path

conda config –add envs_dirs E:\Software\anaconda3\envs

f8de3455f8f44239ad131227e61fcc2e.png

create

view help

conda create -h

6d2dc8c8c10d4b05b2748e4e5f5b4406.png

eb892e148afe4495a602f0e3e752beca.png

create environment

①Create a python3.8 virtual environment named robot

conda create --name robot python=3.8

da560144e8484daba03e3511c105739a.png

clone environment

① According to the environment name

conda create -n robot1 --clone robot

②According to the environment path

conda create -p E:\Software\anaconda3\envs\ robot2 --clone robot

cd07f58472e24f4b97cd1aaf5d65091d.png

fb56fd2a20744c1fb8e34db1222dc2ec.png

info

View configuration information (method 2)

conda info

dc8e4be0f33a45f8b26c3baf59db7089.png

view help

conda info -h

a15b39aae7814042968246546adc7956.png

init

view help

36be7dfee18e4327bab84a043afd8bea.png

install

view help

a65abda895964f2695820123b9c084eb.png

 08a849a6eec84753b8791e2fa2b0ffc4.png

 952f24f07c7d43a296529a50696d124e.png

list

view help

ee6f0e6244594549bcaa06b2441f4c9f.png

List all packages in the current environment

conda list

List all packages installed into environment "robot"

conda list -n robot      # 根据名称

conda list -p E:\Software\anaconda3\envs\robot    #根据路径

a22a8b7c9d424024833087f264f371ec.png

Use "^" to list all packages starting with the letter "p"

conda list ^p

Export installed packages as files

conda list --export > requirements.txt

By default it is stored in the following locations:

e5d0c3858bfa491faad820003c934955.png

Reinstall package from export file

conda create -n robot3 –-file=C:\Users\Lenovo\requirements.txt

package

view help

42dae02fcc564e71aa0f7727fd063432.png

remove

view help

c54056b3b1e749879fecb43e9bd58042.png

 08e6b73ed9b44b47afbc4e3c0b714516.png

delete environment

conda remove --name robot1 --all

conda remove -n robot1 --all

rename

view help

88306a7d3f2048db8f7f9282dade723b.png

run

view help

7522ee3c697f4a578a9bcba29ccd5fca.png

search

view help

d184d17c63a2453f92494fb06f3958a1.png

example

3a3072807c4840528e5ac6e22e6b4944.png

update(upgrate)

view help

d6dd86cfb13d4fec9177b8da14a6797a.png

88dcf8d1df334d9b94ef04f50dff7f63.png

upgrade conda

conda update conda

Upgrade anaconda (need to upgrade conda first)

conda update anaconda

upgrade spyder

conda update spyder

notices

view help

00ca5fbec4df4bc18812132e4875c578.png

Guess you like

Origin blog.csdn.net/m0_63834988/article/details/128780777