python conda下载换源
时间: 2023-12-10 12:32:21 浏览: 42
Python的包管理工具conda默认的下载源可能会非常慢,因此我们可以使用国内的清华大学镜像源来加速下载。具体方法如下:
1. 修改Python的源:打开cmd,输入以下命令:
```
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
```
2. 修改conda的源:有两种方法
- 方法1:修改.condarc文件。在用户目录下找到.condarc文件,如果没有则新建一个,然后添加以下内容:
```
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- defaults
```
- 方法2:通过cmd命令行添加镜像源。输入以下命令:
```
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
```
3. 查看conda环境:输入以下命令:
```
conda env list
```
4. 创建conda虚拟环境:输入以下命令:
```
conda create -n 环境名
```
如果需要指定某些版本,可以在命令后面加上版本号。
相关推荐
![condarc](https://img-home.csdnimg.cn/images/20210720083646.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)