1、问题描述
2、原因
原有的镜像不支持当前包
3、解决方法
①移除当前环境
conda config --remove-key channels
②重新创建虚拟环境
conda create -n python36 python=3.6
4、conda常用命令
#查看虚拟环境
conda info -e
#创建虚拟环境
conda create -n chatbot python=3.7
#删除虚拟环境
conda remove -n your_env_name --all
#进入指定环境
conda activate your_env_name
#退出指定环境
conda deactivate your_env_name
#通过Anaconda安装包
conda install 包名
#检查当前环境中的所有包
conda list
#升级当前版本的Anaconda
conda update conda
#安装指定版本的torch和torchvision(版本对应关系):https://pytorch.org/get-started/previous-versions/
pip3 install torch==1.6.0 torchvision==0.7.0 -i https://pypi.douban.com/simple
或pip install torch==1.8.0 torchvision==0.9.0
#删除之前版本的torch
pip uninstall torch
5、配置国内镜像
豆瓣:https://pypi.douban.com/simple
阿里云:https://mirrors.aliyun.com/pypi/simple
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simpl
执行以下命令:
conda config --add channels https://mirrors.aliyun.com/pypi/simple
conda config --set show_channel_urls yes