InvalidSpecError: Invalid spec: =2.7报错解决办法
1.小编也是被InvalidSpecError: Invalid spec: =2.7这个报错提示搞的头皮发麻,查询网上相关问题众说纷纭,小编基本都试过了,什么修改镜像源这些,丝毫没有解决问题,
2.后来我发现可能是conda版本太低导致的,又或许是当初安装anaconda时没有配置好
3.所以我尝试用conda update conda更新,都是频繁报错如下
C:\Users\dell>conda update conda
Fetching package metadata ....
WARNING: The remote server could not find the noarch directory for the
requested channel with url: https://conda.anaconda.org/'https://conda.anaconda.org/'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
It is possible you have given conda an invalid channel. Please double-check
your conda configuration using `conda config --show`.
If the requested url is in fact a valid conda channel, please request that the
channel administrator create `noarch/repodata.json` and associated
`noarch/repodata.json.bz2` files, even if `noarch/repodata.json` is empty.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.json
..
WARNING: The remote server could not find the noarch directory for the
requested channel with url: https://conda.anaconda.org/'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
It is possible you have given conda an invalid channel. Please double-check
your conda configuration using `conda config --show`.
If the requested url is in fact a valid conda channel, please request that the
channel administrator create `noarch/repodata.json` and associated
`noarch/repodata.json.bz2` files, even if `noarch/repodata.json` is empty.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.json
.................
Solving package specifications:
InvalidSpecError: Invalid spec: =2.7
4.小编被搞到心态炸裂,于是便采用了最暴力的方式----重装anaconda
在此之前建议先找到原先anaconda的安装目录,小编这边是C:\Users\dell\anaconda3,打开后找到unanaconda.exe文件把原先的版本先卸载掉
然后下载新版本,官网如下:
Anacond下载
下载地址:https://www.anaconda.com/download/
根据步骤安装即可(未提到的就按默认选项next就行)
这块建议把第一项添加path路径勾选上,免得后期自己手动配置比较困难
5.安装结束,此时按win+R打开cmd命令行,输入conda --version查看自己当前conda版本
小编这边是更新好的最新版本conda 4.10.1
如果不是这个版本可以用命令行conda update conda来进行更新
6.此后直接用conda命令下载包就不会出现报错了
我是小关,关注我,带你从初级入门编程
希望能帮到大家,问你们要一个赞,你们会给吗,谢谢大家
版权声明:本文版权归作者(@攻城狮小关)和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
大家写文都不容易,请尊重劳动成果~
交流加Q:1909561302
CSDN地址https://blog.csdn.net/Mumaren6/