安装conda/pip/清华源
时间: 2023-11-14 19:07:45 浏览: 121
安装conda/pip/清华源的步骤如下:
1. 安装conda:可以从官网下载对应操作系统的安装包进行安装,也可以使用Miniconda进行安装。
2. 安装pip:在安装了Python之后,pip已经自带安装了。如果没有安装,可以使用以下命令进行安装:
```
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
```
3. 使用清华源:可以使用以下命令将pip源更换为清华源:
```
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
```
相关问题
conda中pip换清华源
在conda中,可以通过更换pip源为清华源来提高软件安装的速度。首先,可以使用以下命令查看当前的pip源配置:
pip config list
然后,可以使用以下命令删除当前的pip源配置:[2]
pip config unset global.index-url
最后,可以使用以下命令添加清华源作为新的pip源配置:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.***从而加快下载速度。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Ubuntu Server 20.04 系统安装(九):pip、conda源更换为清华/阿里源、查看源、删除源](https://blog.csdn.net/u013250861/article/details/126665161)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [conda 清华源配置 pip清华源配置 anconda](https://download.csdn.net/download/weixin_38741966/14036171)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
conda install pip 指定清华源
### 配置清华镜像源通过 Conda 安装 Pip
为了确保能够高效稳定地安装软件包,可以配置 Conda 使用清华大学的镜像源来安装 `pip`。具体操作如下:
对于临时使用清华镜像源的情况,在每次执行安装命令前加上 `-c` 参数指定渠道地址:
```bash
conda install -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pypi/ pip
```
如果希望永久性更改默认下载源为清华镜像,则可以通过修改 `.condarc` 文件实现这一目的。首先创建或编辑该文件以加入新的频道列表[^1]。
#### 方法一:直接编辑 .condarc 文件
找到并打开位于用户目录下的隐藏文件`.condarc` (如果没有此文件则新建),添加以下内容:
```yaml
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- defaults
```
#### 方法二:通过命令行方式设置
也可以不手动编辑文件而是利用 conda 自带指令完成相同效果的操作:
```bash
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
```
这会自动将上述 URL 添加到用户的 channel 列表中,并显示所使用的通道网址以便确认已成功切换至清华镜像源。
一旦完成了这些配置之后,就可以正常运行 `conda update pip` 或者 `conda install pip` 来更新现有版本或是重新安装最新版的 pip 工具了。
阅读全文
相关推荐














