一、下載安裝腳本
1.進(jìn)入Anaconda官網(wǎng)獲取下載鏈接:
2.遠(yuǎn)程拉取安裝腳本
wget https://repo.anaconda.com/archive/Anaconda3-2023.07-1-Linux-x86_64.sh
二、正式安裝
1.運(yùn)行腳本
bash Anaconda3-2023.07-1-Linux-x86_64.sh
之后按照提示回答相應(yīng)問題即可(有選項(xiàng)的都是填 yes,閱讀協(xié)議使用空格跳過,有回車的按回車)
2.配置生效
source .bashrc
三、配置文件
配置文件.condarc
在用戶的家目錄(windows:C:\\users\\username\\
,linux:/home/username/
)。但對于.condarc
配置文件,是一種可選的(optional)運(yùn)行期配置文件,其默認(rèn)情況下是不存在的,但當(dāng)用戶第一次運(yùn)行 conda config
命令時,將會在用戶的家目錄創(chuàng)建該文件。
1.創(chuàng)建 ~/.condarc
conda config
2.配置 ~/.condarc
channels:
- defaults
- conda-forge
show_channel_urls: true
default_channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
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/cloud
menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
opencv: http://conda.anaconda.org/menpo
ssl_verify: false
custom_channels 后續(xù)可以根據(jù)需要添加,比如說 opencv 需要從指定 channel 拉取,我們可以 install 時指定 channel,如下
conda install --channel https://conda.anaconda.org/menpo opencv3
或是直接在上面的配置文件中的 custom_channels 配置 opencv 的 channel
3.配置生效
最后運(yùn)行如下命令清除索引緩存,保證用的是鏡像站提供的索引。
conda clean -i
注意每次更改配置文件 ~/.condarc 都需要執(zhí)行上述命令使配置生效
遇到問題
問題:PackagesNotFoundError: The following packages are not available from current channels
方案 1
從報錯中可以看出需要去 https://anaconda.org 這個網(wǎng)址,在上方的搜索條上搜索你要安裝這個包的其他channel,下邊展示一下如何找igraph的其他channel
方案 2
從官網(wǎng)下載.bz2文件,使用如下命令下載
conda install --use-local python-igraph-0.8.3-py38h0d6bca7_2.tar.bz2
問題:Anaconda3 solving environment 很慢
1.安裝 mamba
conda install -n base --override-channels -c conda-forge mamba 'python_abi=*=*cp*'
注意:上面這種安裝方法官方并不建議,可以查看官網(wǎng)尋找最新安裝方法
2.之后即可使用如下命令
mamba install 包名
mamba remove 包名
遇到問題(windows)
問題:powershell 內(nèi)部原因與 conda 集成失敗
方案
1.升級 conda
conda update conda
conda update anaconda
2.集成 powershell(需要在 powshell 環(huán)境下執(zhí)行)
conda init powershell
問題:CondaHTTPError: HTTP 000 CONNECTION FAILED for url
方案
1.channel https - > http
2.關(guān)閉代理
嘗試使用 anaconda prompt shell 環(huán)境
參考文章
conda 配置文件,換國內(nèi)源 - stardsd - 博客園 (cnblogs.com)
CentOS 7 安裝Anaconda及簡單配置
推薦閱讀
conda的安裝和linux和windows系統(tǒng)下的使用
conda命令大全 - 知乎 (zhihu.com)
User guide — conda documentation文章來源:http://www.zghlxwxcb.cn/news/detail-706102.html
Anaconda 中文網(wǎng)文章來源地址http://www.zghlxwxcb.cn/news/detail-706102.html
到了這里,關(guān)于三步教你輕松安裝配置 Linux Anaconda 環(huán)境的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!