Ubuntu搭建Conda+Python开发环境

目录

一、环境说明

1、测试环境为ubuntu24.04.1

2、更新系统环境

3、安装wget工具

4、下载miniconda安装脚本

二、安装步骤

1、安装miniconda

[2、source conda](#2、source conda)

3、验证版本

4、配置pip源

三、conda用法

1、常用指令


一、环境说明

1、测试环境为ubuntu24.04.1

2、更新系统环境

apt-get update

3、安装wget工具

apt-get install wget

4、下载miniconda安装脚本

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

二、安装步骤

1、安装miniconda

./Miniconda3-latest-Linux-x86_64.sh

2、source conda

source ~/.bashrc

3、验证版本

conda--version

4、配置pip源

cd ~ //跳转到~

mkdir .pip //新建目录.pip

touch pip.conf //创建配置文件,向文件写入如下内容

bash 复制代码
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn

三、conda用法

1、常用指令

1)、conda --version //查看版本号

2)、conda info --envs //查看虚拟环境

3)、 conda create -n xyb-pyenvs-20250502 pip python=3.13.2 //创建指定版本python的虚拟环境

4)、conda activate xyb-pyenvs-20250502 //进入指定虚拟环境

5)、conda deactivate //退出当前虚拟环境

6)、conda remove --name xyb-pyenvs-20250502 --all //删除指定虚拟环境

7)、conda config --show channels //显示当前源

8)、conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ //添加清华源,配置后可以创建指定版本的python环境。

其他常用源推荐

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

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

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

9)、conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ //移除特定源

相关推荐
2401_8582861132 分钟前
OS15.【Linux】gdb调试器的简单使用
linux·运维·服务器·开发语言·gdb
c30%002 小时前
内网渗透——红日靶场五
运维·服务器
宇钶宇夕3 小时前
EPLAN 电气制图:建立自己的部件库,添加部件-加SQL Server安装教程(三)上
运维·服务器·数据库·程序人生·自动化
susu10830189113 小时前
Debian 11 Bullseye 在线安装docker
运维·docker·debian
行止63 小时前
OpenStack云平台管理
linux·openstack
love530love4 小时前
Docker 稳定运行与存储优化全攻略(含可视化指南)
运维·人工智能·windows·docker·容器
岁岁岁平安4 小时前
CentOS-7-x86_64解决:使用NAT模式无法ping通www.baidu.com或无法ping 8.8.8.8问题。
linux·运维·centos·centos-7
运维小贺4 小时前
各服务器厂商调整BIOS睿频教程
linux·运维·服务器·性能优化
网硕互联的小客服4 小时前
如何排查服务器中已经存在的后门程序?
运维·服务器·github
人生匆匆4 小时前
docker进入启动失败的容器
运维·docker·容器