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/