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

相关推荐
用户31187945592181 分钟前
CentOS 7 安装 net-tools.rpm 包步骤详解(附 rpm 命令和 yum 方法)附安装包
linux
我叫黑大帅2 分钟前
什么是 mmap?
linux·c++·操作系统
chuxinweihui3 分钟前
Socket编程UDP
linux·网络·网络协议·udp·通信
游戏开发爱好者85 分钟前
Nginx HTTPS 深入实战 配置、性能与排查全流程(Nginx https
运维·nginx·ios·小程序·https·uni-app·iphone
小闫BI设源码10 分钟前
Docker的介绍
运维·docker·容器·数据持久化·端口映射·卷挂载·配置外挂
万事可爱^18 分钟前
如何在云服务器上使用LLaMA Factory框架微调模型
运维·服务器·llm·sft·llama·模型微调·ai agent
Ronin30524 分钟前
【Linux网络】Socket编程:UDP网络编程实现Echo Server
linux·网络·udp·网络通信·socket编程
霖.2431 分钟前
service的两种代理实现
linux·服务器·容器·kubernetes
新手小白*39 分钟前
Nginx反向代理与缓存功能-第一章
运维·nginx
Lin_Aries_042141 分钟前
基于 GitLab 的自动化镜像构建
linux·运维·docker·容器·自动化·gitlab