linux-centos-安装miniconda3

参考:
最新保姆级Linux下安装与使用conda:从下载配置到使用全流程_linux conda-优快云博客
https://blog.youkuaiyun.com/qq_51566832/article/details/144113661

Linux上删除Anaconda或Miniconda的步骤_linux 删除anaconda-优快云博客
https://blog.youkuaiyun.com/m0_37577608/article/details/123013875

1. 下载

访问清华源:https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda
我选的是
在这里插入图片描述
所以命令为:

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

2. 安装细节

bash Miniconda3-py38_4.9.2-Linux-x86_64.sh

一路按enter,直到遇到,输入yes
在这里插入图片描述
然后修改路径:
在这里插入图片描述
最后允许自动配置。

使用conda config --show,检查配置,发现channels已经配置好了清华源:
在这里插入图片描述

3. 删除

如果要删除Miniconda,只要找到当时的安装路径,整个删除即可。然后检查~/.bashrc,删除对应的环境路径。

rm -rfv path

4. 使用

创建指定版本的环境:
conda create -n 环境名称 python=3.7.2

安装xxx包
conda install xxx
指定版本安装
conda install xxx=x.x.x

查找包的版本
conda search xxx

切换环境
conda activate XXX

展示所有环境
conda env list

展示所有的环境名称及路径
conda info -e

进默认环境 (带名字就是进入指定环境了)
conda activate

如果没有环境名,也可以通过路径进入
conda activate <env_path>

退出
conda deactivate 

删除环境及里面的内容
conda env remove --name 环境名

迁移环境(name是新名称,path是原路径)
conda create -n name --clone path

5. 报错

[root@localhost home]# conda activate xx

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

一般输入conda init即可。可能需要检查一下~/.bashrc,看有没有加入miniconda的环境路径。如果没加,手动加,然后source。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值