如果出现Solving environment: failed问题;一般是网络问题;只需要设置一下镜像源;
方法一;
windows 系统
打开 cmd 命令行;win图标键 ; R;输入 cmd 回车
同样按条复制粘贴回车下列命令;
conda config --add channels http://mirrors.aliyun.com/anaconda/pkgs/main
conda config --add channels http://mirrors.aliyun.com/anaconda/pkgs/r
conda config --add channels http://mirrors.aliyun.com/anaconda/pkgs/msys2
conda config --set show_channel_urls yes
方法二;建议;;
在文件中加入国内镜像源;
channels:
- http://mirrors.aliyun.com/anaconda/pkgs/free/
- http://mirrors.aliyun.com/anaconda/pkgs/main/
show_channel_urls: true
ssl_verify: true
注;如果还是有问题;换镜像源不断尝试一下
镜像源列表;
方法一;
建议在anaconda3envspy36Libsite-packages>路径内安装文件包;但是记得要在环境变量中引用。
使用requirements.txt对环境需要的版本信息进行安装与更新;
(py36) F:anaconda3envspy36Libsite-packages>pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
// 报错
D:Usersanaconda3envspytorchlibsite-packages orchvisionioimage.py:11: UserWarning: Failed to load image Python extension: [WinError 126] 找不到指定的模块。
warn(f;Failed to load image Python extension: {e};)
如果版本错误;可以先卸载torchvision;pip uninstall torchvision
在直接安装需要版本;pip install torchvision==0.11.1 -i https://mirrors.aliyun.com/pypi/simple/
会自动重新安装torch和torchvision的版本;
关于图中标黄警告错误;只需要找到括号内的路径;删除带~的文件夹即可消除。
(py36) F:anaconda3envspy36>pip list
# Cannot open F:anaconda3envspy36ScripTSPip-script.py
(py36) F:anaconda3envspy36> python -m pip install --upgrade pip
# F:anaconda3envspy36python.exe: No module named pip
(py36) F:anaconda3envspy36>python -m ensurepip
# Looking in links: C:UsersADMINI~1AppDataLocalTemp mp3dn_qonx
# Requirement already satisfied: setuptools in f:anaconda3envspy36libsite-packages (36.4.0)
# Collecting pip
# Installing collected packages: pip
# Successfully installed pip-18.1
(py36) F:anaconda3envspy36>python -m pip install --upgrade pip
# Collecting pip
# Using cached
# https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-
# py3-none-any.whl
# Installing collected packages: pip
# Found existing installation: pip 18.1
# Uninstalling pip-18.1:
# Successfully uninstalled pip-18.1
# Successfully installed pip-21.3.1
安装docx库;
pip install python-docx
配置深度学习环境:在Windows(Win10)中安装CUDA,CUDNN,Pytorch-GPU版