---
title: "一条命令将pip更换清华镜像源"
id: "2721"
type: "post"
slug: "%e4%b8%80%e6%9d%a1%e5%91%bd%e4%bb%a4%e5%b0%86pip%e6%9b%b4%e6%8d%a2%e5%9b%bd%e5%86%85%e9%95%9c%e5%83%8f%e6%ba%90"
published_at: "2020-03-19T16:07:55+00:00"
modified_at: "2020-03-19T16:12:22+00:00"
url: "https://seq.ink/all/2721.html"
markdown_url: "https://seq.ink/all/2721.html.md"
excerpt: "1.先升级为最新版本的pip pip install pip -U -i https://pypi.tuna.tsinghua.edu.cn/simple some-package 2.执行这条命令换源 pip config set glo ..."
taxonomy_category:
  - "ALL"
---

1.先升级为最新版本的pip

```
pip install pip -U  -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
```

2.执行这条命令换源

```
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
```
