linux安装anaconda
1.获取Anaconda
wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
2. 执行
bash Anaconda3-2020.07-Linux-x86_64.sh
3. 根据提示按ENTER
该yes的yes
4.配置环境变量
vim /etc/profile
export PATH=/home/(your_user_name)/anaconda3/bin:$PATH
source /etc/profile
# 配置源
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 测试是否安装成功
conda --version
# 查看当前存在哪些环境
conda env list
# 创建新的虚拟环境
conda create -n your_env_name python=X.X(2.7、3.6等)
# 激活虚拟环境
source activate your_env_name
# 安装conda没有的包
pip install pckage_name
# 关闭虚拟环境
source deactivate
# 删除虚拟环境
conda remove -n your_env_name -all
如果出现下述情况:
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/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.
'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64'
查看anaconda配置的镜像源
conda config --show-sources
备份anaconda3下的.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/
show_channel_urls: True
清楚anaconda缓存
conda clean -i
浙公网安备 33010602011771号