Miniconda3的安装

miniconda安装

借助miniconda安装python,便于多种Python环境的管理。

1)下载最新版本的minconda

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh

注意:若提示wget命令不存在,执行 yum install wget -y 安装即可

2)安装miniconda

[root@song envs]# ll
total 65148
-rw-r--r--. 1 root root 66709754 Jul 22 00:13 Miniconda3-latest-Linux-x86_64.sh
[root@song envs]# chmod 777 Miniconda3-latest-Linux-x86_64.sh #给执行权限
[root@song envs]# bash Miniconda3-latest-Linux-x86_64.sh #运行
···
Please answer 'yes' or 'no':'
>>> yes

Miniconda3 will now be installed into this location:
/root/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/miniconda3] >>> /root/envs/miniconda3		#选择yes默认安装位置;或者直接自定义路径

3)测试安装是否成功

(base) [root@song bin]# conda -V
conda 4.10.3

显示版本号,则安装成功。

若显示conda命令找不到,则环境变量配置有问题或者未生效

[root@song envs]# conda -V
bash: conda: command not found...

解决方法:

[root@song bin]# vim ~/.bashrc		#查看是否配置环境变量
#在最后一行加上,取决于每个人的实际安装路径
export PATH=$PATH:/root/envs/miniconda3/bin

[root@song bin]# source ~/.bashrc		#运行生效
(base) [root@song bin]# conda -V
conda 4.10.3

拓展:配置镜像源

(base) [root@song bin]#cp ~/.condarc ~/.condarc.bak  #以防出错,先备份

(base) [root@song bin]# cd ~
(base) [root@song ~]# vim .condarc
#将内容全部删除,修改为下面的配置
(base) [root@song ~]# conda clean -i 	#清除缓存

channels:
  - defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值