Ubuntu 22.04 anaconda pip换阿里源
时间: 2024-04-28 19:04:55 浏览: 143
尝试探索ubuntu——anaconda安装与使用
5星 · 资源好评率100%
1. 打开终端,输入以下命令安装anaconda和pip:
```
wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh
bash Anaconda3-2021.11-Linux-x86_64.sh
source ~/.bashrc
conda update conda
pip install -U pip
```
2. 输入以下命令修改pip的源为阿里云源:
```
mkdir ~/.pip
touch ~/.pip/pip.conf
echo "[global]" >> ~/.pip/pip.conf
echo "index-url=https://mirrors.aliyun.com/pypi/simple/" >> ~/.pip/pip.conf
echo "[install]" >> ~/.pip/pip.conf
echo "trusted-host=mirrors.aliyun.com" >> ~/.pip/pip.conf
```
3. 输入以下命令验证pip源是否修改成功:
```
pip config list
```
如果输出中有以下内容,说明成功修改为阿里云源:
```
global.index-url='https://mirrors.aliyun.com/pypi/simple/'
install.trusted-host='mirrors.aliyun.com'
```
阅读全文