linux 安装anaconda3

1.下载

使用repo镜像网址下载对应安装包

右击获取下载地址,使用终端下载

bash 复制代码
wget https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh

2.安装

使用以下命令可直接指定位置

bash 复制代码
bash Anaconda3-2024.02-1-Linux-x86_64.sh -b -p /home/anaconda3

也可以在安装过程中,编辑安装位置,直接使用以下命令

bash 复制代码
bash Anaconda3-2024.02-1-Linux-x86_64.sh

3.配置环境变量

bash 复制代码
vim /etc/profile

最后添加一行

bash 复制代码
export PATH=/home/anaconda3/bin:$PATH

刷新配置

bash 复制代码
source /etc/profile

使用 conda -V可查看版本即安装成功

如果你想在root用户也可以使用conda,则需要进行一下配置,进入root账户

bash 复制代码
vim ~/.bashrc

添加conda路径

bash 复制代码
export PATH="/home/anaconda3/bin:$PATH"

刷新即可使用

bash 复制代码
source ~/.bashrc
conda init  # 将conda其他命令都会自动加入到bashrc中
source ~/.bashrc

4.常用命令

bash 复制代码
conda create --name 环境名 python==版本  #创建环境
bash 复制代码
conda env list # 查看所有环境
bash 复制代码
conda env remove --name 环境名  #删除环境
bash 复制代码
pip install -r requirements.txt  #安装包 - 根据文件配置
bash 复制代码
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple   # 设置默认镜像

常见pip镜像

bash 复制代码
百度 https://mirror.baidu.com/pypi/simple
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

5.其他

当conda环境移植的时候,需要对pip文件进行修改

相关推荐
AlfredZhao8 小时前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao1 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334661 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪1 天前
linux 拷贝文件或目录到指定的位置
linux
大树882 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠2 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
bush42 天前
嵌入式linux学习记录十四、术语
linux·嵌入式
载数而行5202 天前
Linux 11 动态监控指令top
linux
小宇宙Zz2 天前
Maven依赖冲突
java·服务器·maven
不会C语言的男孩2 天前
Linux 系统编程 · 第 8 章:进程基础
linux·c语言