Table of contents
Different Ways to Open a Command Line Execution Window
Clean up useless installation packages
Clean up all installation packages and cache
View configuration information (method 1)
Change (add, delete) the virtual environment default installation path
View configuration information (method 2)
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
Upgrade anaconda (need to upgrade conda first)
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.
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
After successful modification
Anaconda Prompt
view help
conda
conda -h
conda –-help
view version
conda -V
conda –-version
View all virtual environments
conda env list
conda info -e
conda info --envs
Activate the environment
conda activate robot
activate robot # cmd中可以省略conda
close environment
conda deactivate
command encyclopedia
clean clean up
view help
conda clean -h
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
config
view help
View configuration information (method 1)
conda config –show
view source
conda config --show-sources
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
create
view help
conda create -h
create environment
①Create a python3.8 virtual environment named robot
conda create --name robot python=3.8
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
info
View configuration information (method 2)
conda info
view help
conda info -h
init
view help
install
view help
list
view help
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 #根据路径
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:
Reinstall package from export file
conda create -n robot3 –-file=C:\Users\Lenovo\requirements.txt
package
view help
remove
view help
delete environment
conda remove --name robot1 --all
conda remove -n robot1 --all
rename
view help
run
view help
search
view help
example
update(upgrate)
view help
upgrade conda
conda update conda
Upgrade anaconda (need to upgrade conda first)
conda update anaconda
upgrade spyder
conda update spyder