anaconda3 | 使用中常見(jiàn)錯(cuò)誤

1. conda安裝環(huán)境報(bào)錯(cuò):Solving environment: failed with initial frozen solve.

$conda install -c bioconda hypo
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

方案1:
首先从绘,把你安裝的anaconda卸了重裝,反正我是這么干的,強(qiáng)迫癥患者刹淌,這樣干凈

更新conda到最新版本:conda update -n base conda
再查一下conda版本:conda -V
并不是最新版本conda 4.7.11
第二次更新conda到最新版本:conda update -n base conda
第二次很重要M扇啊Qㄕ拧!而且适滓,這次它讀環(huán)境的時(shí)候賊慢,我以為我電腦卡死機(jī)了呢恋追,半年不動(dòng)彈凭迹,等著就行了
更新完后再查一下conda版本:conda -V罚屋,發(fā)現(xiàn)是最新版本conda 4.7.11
然后執(zhí)行:conda update --all
然后,裝啥啥好使嗅绸,整啥啥好使脾猛,啥啥都好使,好使就完事了S沭<夤觥!G迫帷F崤!

方案2:

# 更新conda
conda update -n base conda
conda update -all

# 修改頻道 
conda config --add channels conda-forge
conda config --set channel_priority flexible

# 重新嘗試

2. conda安裝庫(kù)時(shí)報(bào)錯(cuò)Solving environment: failed with initial frozen solve. Retrying with flexible solve.

conda安裝庫(kù)時(shí)報(bào)錯(cuò):


圖片.png

發(fā)現(xiàn)原因

后來(lái)查看錯(cuò)誤信息的時(shí)候發(fā)現(xiàn)造锅,原來(lái)是為了使用conda-forge的兩條命令導(dǎo)致此錯(cuò)誤撼唾。罪魁禍?zhǔn)资堑诙洹?/p>

conda config --add channels conda-forge
conda config --set channel_priority strict

解決方案:

解決方法:

conda config --add channels conda-forge
conda config --set channel_priority flexible

3. conda install遇到Segmentation fault錯(cuò)誤

出錯(cuò)原因:可能是之前安裝的時(shí)候網(wǎng)絡(luò)不好導(dǎo)致中途中斷,這個(gè)包只下載了一部分哥蔚,但是并不完整倒谷。因此需要把之前下載的壓縮包刪除,再進(jìn)行安裝糙箍。

解決方案1:通過(guò)conda clean進(jìn)行清理渤愁。

conda clean -a 刪除所有包all,緩存 -i深夯,鎖定文件抖格,無(wú)用緩存-p,tar包-t
conda clean -i 刪除緩存index cache
conda clean -p 刪除未使用的緩存咕晋。
conda clean -t 刪除緩存tar包
conda clean -f 刪除所有可寫的程序包緩存雹拄,此項(xiàng)不包含在-a命令中
conda clean -c 刪除由于正在使用而無(wú)法刪除的臨時(shí)文件
conda clean -a 

刪除所有的緩存。

進(jìn)入anaconda/pkgs 找到下載的不完整的壓縮包掌呜,刪除即可

解決方案2:在base環(huán)境中執(zhí)行以下命令滓玖,清除緩存位置(…/anaconda3/pkgs/)中未下載完的文件。
在anaconda/pkgs 找到下載的不完整的壓縮包质蕉,然后刪除势篡,再conda install這個(gè)包就沒(méi)問(wèn)題了

4. 使用conda命令安裝時(shí)報(bào)錯(cuò):CondaHTTPError

(1)方案1:親測(cè)可用

$conda install anaconda-clean
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.ustc.edu.cn/anaconda/pkgs/free/linux-64/repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https://mirrors.ustc.edu.cn/anaconda/pkgs/free/linux-64'

channels問(wèn)題,個(gè)人認(rèn)為比較快的解決方式是運(yùn)行以下命令:把鏡像里面的模暗,https改為http

conda config --remove-key channels   #刪除所有的channels,沒(méi)運(yùn)行通

#添加清華鏡像源
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda 
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge 
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ 
conda config --set show_channel_urls yes    # 搜索時(shí)顯示通道地址


#或者中科大鏡像
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/linux-64
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes 

這次再安裝bioconda 和 conda-forge是鏡像

conda install -c bioconda  module
conda install -c conda-forge module

(2)方案2
換源吧:
??阿里云 http://mirrors.aliyun.com/pypi/simple/
??中國(guó)科技大學(xué) https://pypi.mirrors.ustc.edu.cn/simple/
??豆瓣(douban) http://pypi.douban.com/simple/
??清華大學(xué) https://pypi.tuna.tsinghua.edu.cn/simple/
??中國(guó)科學(xué)技術(shù)大學(xué) http://pypi.mirrors.ustc.edu.cn/simple/
(3)方案3(親測(cè)可用)
打開(kāi).condarc文件禁悠,更改為如下:

vim ~/.condarc
channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
show_channel_urls: true
ssl_verify: false

(4)方案4

#首先先添加清華的鏡像源 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
conda config --set show_channel_urls yes 

#如果無(wú)法解決,則刪除channels配置文件中部分內(nèi)容
 #具體操作如下: 

#1汰蓉、快速創(chuàng)建channels配置文件的備份(保險(xiǎn)起見(jiàn)) 
cp ~/.condarc{,.bak} 

#查看配置文件的內(nèi)容 
cat ~/.condarc.bak 
channels: 
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ 
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ 
- https://nanomirrors.tuna.tsinghua.edu.cn/anaconda/cloud 
- defaults 
- https://nanomirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda 
- https://nanomirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/conda 
- bioconda 
- r 
- conda-forge 
show_channel_urls: true 
#2绷蹲、刪除部分內(nèi)容
 ## 主要是刪除此行:
 - defaults 

#修改后配置文件的內(nèi)容如下: 
vim ~/.condarc 
channels: 
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ 
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ 
show_channel_urls: true 

5. 使用conda命令安裝時(shí)報(bào)錯(cuò):('Connection broken: OSError("(104, 'ECONNRESET')")', OSError("(104, 'ECONNRESET')"))

$conda install -c bioconda kmc
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/liuliu/software/anaconda3

  added / updated specs:
    - kmc


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-4.8.3                |           py37_0         2.8 MB
    kmc-3.1.2rc1               |       h2d02072_0        13.1 MB  bioconda
    ------------------------------------------------------------
                                           Total:        15.9 MB

The following NEW packages will be INSTALLED:

  kmc                bioconda/linux-64::kmc-3.1.2rc1-h2d02072_0

The following packages will be UPDATED:

  conda                                        4.8.2-py37_0 --> 4.8.3-py37_0


Proceed ([y]/n)? y   


Downloading and Extracting Packages
conda-4.8.3          | 2.8 MB    | ################################################################################################################################################################ | 100% 
kmc-3.1.2rc1         | 13.1 MB   | ##################################################9                                                                                                              |  32% 

('Connection broken: OSError("(104, \'ECONNRESET\')")', OSError("(104, 'ECONNRESET')"))

發(fā)生場(chǎng)景:在Ubuntu,使用Anaconda安裝一些包。
這種問(wèn)題大概就是下載國(guó)外的包什么的網(wǎng)速太慢了祝钢,下載失敗比规。

解決辦法:
用國(guó)內(nèi)的鏡像算了。這里我用的清華大學(xué)的一個(gè)鏡像開(kāi)源下的:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
在終端直接復(fù)制粘貼:

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

再使用conda install安裝你想裝的包吧

6. CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'

首次使用 source activate 命令激活虛擬環(huán)境

source activate R3.6
# 退出虛擬環(huán)境
conda deactivate

否則會(huì)報(bào)下面的錯(cuò)

7. PackagesNotFoundError: The following packages are not available from current channels

解決辦法:將conda-forge添加到搜索路徑上

首先拦英,當(dāng)出現(xiàn)這種報(bào)錯(cuò)時(shí)蜒什,應(yīng)該首先嘗試使用以下命令將conda-forge channel添加到你的channel列表中:

conda config --append channels conda-forge

它告訴conda在搜索軟件包時(shí)也要在conda-forge channel上查看。

然后你就可以嘗試?yán)萌缦旅钤俅伟惭b

conda install 包名

原因在于:channel可以看成是托管python包的服務(wù)器疤估,當(dāng)無(wú)法通過(guò)標(biāo)準(zhǔn)channel獲得python包時(shí)灾常,社區(qū)驅(qū)動(dòng)的conda-forge通常是一個(gè)很好的地點(diǎn)。大部分問(wèn)題都可以利用這條語(yǔ)句解決铃拇。

8. Collecting package metadata (current_repodata.json): failed

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

'https//repo.anaconda.com/pkgs/main/linux-64'

解決辦法:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

https://www.csdn.net/gather_2b/MtTakgysMjczODEtYmxvZwO0O0OO0O0O.html

9 conda安裝軟件報(bào)兼容性問(wèn)題的解決 Found conflicts! Looking for incompatible packages.failed.UnsatisfiableError

嘗試對(duì)conda更新以解決兼容性問(wèn)題

conda update --all
conda update conda

還是不行钞瀑,報(bào)錯(cuò)如下

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \ 
Found conflicts! Looking for incompatible packages.                                    failed                                                                                     

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.31=0
  - feature:|@/linux-64::__glibc==2.31=0
  - **A程序** -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.31

添加國(guó)內(nèi)鏡像

conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/bioconda/
conda config --add channels http://mirrors.aliyun.com/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

再進(jìn)行安裝,成功慷荔。

10. conda 嘗試解決沖突但失敗了雕什。

為什么都已經(jīng)創(chuàng)建新的環(huán)境了,conda 安裝軟件還是報(bào)錯(cuò).

conda create -n merqury.1.3  
conda activate merqury.1.3   

conda install -c bioconda merqury
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.                                                                                                                                   failed

UnsatisfiableError:

這個(gè)錯(cuò)誤可能是由一個(gè)或多個(gè)包之間的版本沖突導(dǎo)致的显晶,conda嘗試解決沖突但失敗了贷岸。以下是一些可能的解決方案:

(1)使用mamba代替conda:Mamba是一個(gè)由conda社區(qū)開(kāi)發(fā)的,與conda兼容的包管理器磷雇。它在處理包依賴關(guān)系及沖突問(wèn)題時(shí)偿警,通常會(huì)比conda更有優(yōu)勢(shì)。

執(zhí)行以下命令安裝mamba:

conda install mamba -n base -c conda-forge 

使用mamba安裝Merqury:

mamba install -c bioconda merqury

(2)更新conda:有時(shí)候唯笙,這個(gè)問(wèn)題可能是由于conda版本過(guò)舊引起的螟蒸。你可以執(zhí)行 conda update conda 來(lái)嘗試更新conda。

(3)指定包版本:你可以嘗試以特定版本安裝包睁本。例如尿庐,如果你想安裝merqury的1.3版,你可以使用

conda install -c bioconda merqury=1.3呢堰。

不過(guò)在嘗試這些解決方案之前,請(qǐng)記住在嘗試安裝任何包之前先激活你的環(huán)境凡泣。此外枉疼,你可能也需要確保你的Bioconda頻道設(shè)置正確。你可以通過(guò)運(yùn)行 conda config --show channels 來(lái)查看你目前的頻道設(shè)置鞋拟。如果你沒(méi)有看到bioconda骂维,你可以使用 conda config --add channels bioconda 來(lái)添加。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末贺纲,一起剝皮案震驚了整個(gè)濱河市航闺,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖潦刃,帶你破解...
    沈念sama閱讀 217,277評(píng)論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件侮措,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡乖杠,警方通過(guò)查閱死者的電腦和手機(jī)分扎,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,689評(píng)論 3 393
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)胧洒,“玉大人畏吓,你說(shuō)我怎么就攤上這事∥缆” “怎么了菲饼?”我有些...
    開(kāi)封第一講書人閱讀 163,624評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)列赎。 經(jīng)常有香客問(wèn)我宏悦,道長(zhǎng),這世上最難降的妖魔是什么粥谬? 我笑而不...
    開(kāi)封第一講書人閱讀 58,356評(píng)論 1 293
  • 正文 為了忘掉前任肛根,我火速辦了婚禮,結(jié)果婚禮上漏策,老公的妹妹穿的比我還像新娘派哲。我一直安慰自己,他們只是感情好掺喻,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,402評(píng)論 6 392
  • 文/花漫 我一把揭開(kāi)白布芭届。 她就那樣靜靜地躺著,像睡著了一般感耙。 火紅的嫁衣襯著肌膚如雪褂乍。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書人閱讀 51,292評(píng)論 1 301
  • 那天即硼,我揣著相機(jī)與錄音逃片,去河邊找鬼。 笑死只酥,一個(gè)胖子當(dāng)著我的面吹牛褥实,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播裂允,決...
    沈念sama閱讀 40,135評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼损离,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了绝编?” 一聲冷哼從身側(cè)響起僻澎,我...
    開(kāi)封第一講書人閱讀 38,992評(píng)論 0 275
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤貌踏,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后窟勃,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體祖乳,經(jīng)...
    沈念sama閱讀 45,429評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,636評(píng)論 3 334
  • 正文 我和宋清朗相戀三年拳恋,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了凡资。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,785評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡谬运,死狀恐怖隙赁,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情梆暖,我是刑警寧澤伞访,帶...
    沈念sama閱讀 35,492評(píng)論 5 345
  • 正文 年R本政府宣布,位于F島的核電站轰驳,受9級(jí)特大地震影響厚掷,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜级解,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,092評(píng)論 3 328
  • 文/蒙蒙 一冒黑、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧勤哗,春花似錦抡爹、人聲如沸。這莊子的主人今日做“春日...
    開(kāi)封第一講書人閱讀 31,723評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至民逼,卻和暖如春泵殴,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背拼苍。 一陣腳步聲響...
    開(kāi)封第一講書人閱讀 32,858評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工笑诅, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人疮鲫。 一個(gè)月前我還...
    沈念sama閱讀 47,891評(píng)論 2 370
  • 正文 我出身青樓苟鸯,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親棚点。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,713評(píng)論 2 354