linuxmint20.3 安装anaconda、换源及创建新环境

本文用来记录linuxmint20.3 安装anaconda、换源及创建新环境的过程,同时记录一些相关命令

目录

anaconda安装

相关命令

创建新环境

显示问题

分析问题

换源

清华源

中科大源

默认源


anaconda安装

下载anaconda(链接

安装

bash Anaconda3-2021.11-Linux-x86_64.sh

#安装anaconda(.sh文件 bash+文件名安装)

进入安装后,会显示conda的copyright,一直回车即可

:但是也要注意,在copyright结束后,会显示

Do you wish the installer to initialize Anaconda3 by running conda init?

这里需要手动输入yes(如果此处回车,会默认为no)

安装完成会显示“Thank you for installing Anaconda3!”

相关命令

1. conda -V
#查看Anaconda的版本信息
2. conda config --show
#查看conda配制
3. python3
#可以查看python的版本信息,Ctrl+d可以退出当前状态
4. anaconda-navigator
#打开Anaconda的图形界面
5. conda config --set auto_activate_base false
#关闭自动进入base环境#把false换为true即为开启
6. conda create -n python38 python=3.8 anaconda
#新建一个python版本号为3.8的环境并命名为python38
7. conda activate python38
#激活名为python38的环境
8. source activate python38
#切换成名为python38的环境
9.conda deactivate
#退出当前环境
10. conda info --env
#查看所有python环境,带*为当前所在环境
11. conda remove -n Python38 --all
#删除名为Python38的环境

 

创建新环境

conda create -n python38 python=3.8 anaconda

#新建一个python版本号为3.8的环境并命名为python38

遇到问题如图

显示问题

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'

分析问题

之前安装好anaconda之后,换了清华的源,可能是这个导致网络问题

conda config --remove-key channels
#换回默认源

换回默认源后,重新创建,成功

换源

清华源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
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/cloud/bioconda/
conda config --set show_channel_urls yes 
conda config --get channels

中科大源

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/

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

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/

conda config --set show_channel_urls yes

默认源

conda config --remove-key channels #换回默认源


其他软件安装总目录

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值