35 lines
802 B
Markdown
35 lines
802 B
Markdown
---
|
||
title: 修改pip源
|
||
createTime: 2022/10/19 16:34:09
|
||
tags:
|
||
- python
|
||
categories:
|
||
- 随记
|
||
---
|
||
|
||
1. 临时换源
|
||
|
||
```powershell
|
||
pip install xxx -i https://pypi.mirrors.ustc.edu.cn/simple/
|
||
```
|
||
|
||
2. 永久换源
|
||
|
||
```powershell
|
||
pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/
|
||
```
|
||
|
||
也可以修改配置文件,linux 在`~/.pip/pip.conf`,Windows 在`C:\Users\YourUserName\AppData\Roaming\pip\pip.ini`,内容为:
|
||
|
||
```ini
|
||
[global]
|
||
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
|
||
```
|
||
|
||
> 常用源
|
||
> 中国科学技术大学 https://pypi.mirrors.ustc.edu.cn/simple/
|
||
> 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
|
||
> 阿里云 https://mirrors.aliyun.com/pypi/simple/
|
||
> 豆瓣 https://pypi.douban.com/simple/
|
||
> 华中科技大学 https://pypi.hustunique.com/
|