2026-04-02 23:12:36 +08:00

35 lines
802 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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/