Blame
|
1 | # Python 代理配置 |
||||||
| 2 | ||||||||
| 3 | ## pip |
|||||||
| 4 | ||||||||
|
5 | ```sh |
||||||
|
6 | pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ |
||||||
| 7 | ``` |
|||||||
| 8 | ||||||||
| 9 | > 该命令写入配置文件 `~/.config/pip/pip.conf` |
|||||||
| 10 | ||||||||
| 11 | cat ~/.pip/pip.conf |
|||||||
| 12 | ||||||||
| 13 | ```conf |
|||||||
| 14 | [global] |
|||||||
| 15 | index-url = http://mirrors.aliyun.com/pypi/simple/ |
|||||||
| 16 | ||||||||
| 17 | [install] |
|||||||
| 18 | trusted-host=mirrors.aliyun.com |
|||||||
| 19 | ``` |
|||||||
| 20 | ||||||||
| 21 | 阿里云内网配置 |
|||||||
| 22 | ||||||||
|
23 | ```sh |
||||||
| 24 | pip config set global.index-url https://mirrors.cloud.aliyuncs.com/pypi/simple/ |
|||||||
| 25 | ``` |
|||||||
| 26 | ||||||||
|
27 | ```conf |
||||||
| 28 | [global] |
|||||||
| 29 | index-url=http://mirrors.cloud.aliyuncs.com/pypi/simple/ |
|||||||
| 30 | ||||||||
| 31 | [install] |
|||||||
| 32 | trusted-host=mirrors.cloud.aliyuncs.com |
|||||||
| 33 | ``` |
|||||||