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ò):
發(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)添加。