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文件进行修改

相关推荐
va学弟7 小时前
Java 网络通信编程(6):视频通话
java·服务器·网络·音视频
V__KING__9 小时前
systemd-remount-fs,fstab之间的渊源
linux·服务器·网络
酿情师9 小时前
Windows Subsystem for Linux (WSL, Ubuntu)安装教程(详细)
linux·windows·ubuntu
Titan202410 小时前
Linux环境变量个人笔记
linux·服务器·c++
zx_zx_12310 小时前
传输层协议tcp (2)
服务器·网络·tcp/ip
青柠代码录10 小时前
【Linux】路径区分:testdir、testdir/、testdir/*
linux·运维·服务器
7yewh10 小时前
jetson_yolo_deployment 02_linux_dev_skills
linux·python·嵌入式硬件·yolo·嵌入式
supersolon10 小时前
Windows下WSL(Ubuntu24.04)安装Nodejs
linux·ubuntu·node.js
进击切图仔11 小时前
跨系统时间戳同步问题解决总结
linux