目錄
一、環境說明
1、測試環境為ubuntu24.04.1
2、更新系統環境
3、安裝wget工具
4、下載miniconda安裝腳本
二、安裝步驟
1、安裝miniconda
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 //創建配置文件,向文件寫入如下內容
[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/? //移除特定源