創建/洗掉環境:
#查看conda虛擬環境串列
conda env list
#創建一個名為testpy的python3.10環境
conda create -n testpy python==3.10
#進入環境testpy
activate testpy
#退出環境
deactivate
#洗掉環境testpy
conda remove -n testpy --all
換源:
#查看當前下載源
conda config --show-sources
#添加源
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
#從channel中安裝包時顯示channel的url,這樣就可以知道包的安裝來源
conda config --set show_channel_urls yes
#還原默認源
conda config --remove-key channels
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/542755.html
標籤:Python
