之前也用anaconda创建过新的虚拟环境,使用的是清华的镜像源,但是从这次再进行创建的时候报错了,在网上搜了好久都没有解决,决定记录一下我的步骤。
首先看看我们的报错是否一样吧
environment variables:
CIO_TEST=
CONDA_DEFAULT_ENV=yolov4
CONDA_EXE=F:\Anaconda\anaconda\Scripts\conda.exe
CONDA_PREFIX=F:\Anaconda\anaconda\envs\yolov4
CONDA_PREFIX_1=F:\Anaconda\anaconda
CONDA_PROMPT_MODIFIER=(yolov4)
CONDA_PYTHON_EXE=F:\Anaconda\anaconda\python.exe
CONDA_ROOT=F:\Anaconda\anaconda
CONDA_SHLVL=2
HOMEPATH=\Users\Administrator
PATH=F:\Anaconda\anaconda;F:\Anaconda\anaconda\Library\mingw-w64\bin;F:\Ana
conda\anaconda\Library\usr\bin;F:\Anaconda\anaconda\Library\bin;F:\Ana
conda\anaconda\Scripts;F:\Anaconda\anaconda\bin;F:\Anaconda\anaconda\e
nvs\yolov4;F:\Anaconda\anaconda\envs\yolov4\Library\mingw-w64\bin;F:\A
naconda\anaconda\envs\yolov4\Library\usr\bin;F:\Anaconda\anaconda\envs
\yolov4\Library\bin;F:\Anaconda\anaconda\envs\yolov4\Scripts;F:\Anacon
da\anaconda\envs\yolov4\bin;F:\Anaconda\anaconda\condabin;F:\Anaconda
anaconda;F:\Anaconda\anaconda\Library\mingw-w64\bin;F:\Anaconda\anacon
da\Library\usr\bin;F:\Anaconda\anaconda\Library\bin;F:\Anaconda\anacon
da\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:
\Program Files\Microsoft VS Code\bin;D:\matlab2016b\runtime\win64;D:\m
atlab2016b\bin;D:\matlab2016b\polyspace\bin;F:\OPENCV\build\x64\vc15\b
in;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps
PSMODULEPATH=C:\Users\Administrator\Documents\WindowsPowerShell\Modules;C:\Program
Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell
v1.0\Modules
REQUESTS_CA_BUNDLE=
SSL_CERT_FILE=
active environment : yolov4
active env location : F:\Anaconda\anaconda\envs\yolov4
shell level : 2
user config file : C:\Users\Administrator\.condarc
populated config files : C:\Users\Administrator.condarc
conda version : 4.8.3
conda-build version : 3.15.1
python version : 3.7.3.final.0
virtual packages :
base environment : F:\Anaconda\anaconda (writable)
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch
package cache : F:\Anaconda\anaconda\pkgs
C:\Users\Administrator.conda\pkgs
C:\Users\Administrator\AppData\Local\conda\conda\pkgs
envs directories : F:\Anaconda\anaconda\envs
C:\Users\Administrator.conda\envs
C:\Users\Administrator\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.8.3 requests/2.22.0 CPython/3.7.3 Windows/10 Windows/10.0.18362
administrator : True
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
[y/N]:
我使用 conda create -n NAME python=3.7 这句命令
这时候可以查看一下这个路径 C:\Users\Administrator下的.condarc文件,如果有-default 就把那行删除再重新试一下但是我还是报错了
所以我更换了镜像源,把.condarc文件内容直接改掉
这是原来清华的:
这是改过的:
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
然后保存,关掉,重新打开anaconda prompt输入conda create -n NAME python=3.7就好啦