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/ //移除特定源

相关推荐
keep__go15 分钟前
zookeeper单机版安装
大数据·运维·zookeeper
chde2Wang21 分钟前
Linux中bash: ls: 未找到命令… 相似命令是: ‘lz‘
linux·运维·bug·bash
楼田莉子1 小时前
Linux学习:进程的控制
linux·运维·服务器·c语言·后端·学习
JiMoKuangXiangQu1 小时前
Linux:文件 mmap 读写流程简析
linux·内存管理·file mmap
捷智算云服务1 小时前
H100服务器维修“病历卡”:五大常见故障现象与根源分析
运维·服务器
wzlsunice881 小时前
用vir-manager创建kvm虚拟机(创建网桥和配置网络等)
运维·网络
南方以南_2 小时前
CKA07--Argo CD
运维·kubernetes·k8s
洋芋土豆2 小时前
linux用户及权限管理
linux·运维·服务器
Stara05113 小时前
Ubuntu环境中LLaMA Factory 的部署与配置—构建大语言模型微调平台
ubuntu·lora·大语言模型·模型微调·qlora·llama-factory·实践指南
塔能物联运维3 小时前
物联网运维中的自适应DNS解析优化与动态负载均衡技术
运维·物联网·负载均衡