简介:Python pip是Python的包管理器,用于安装和管理Python包。有时候我们需要更换pip的源,以便更快地下载和安装包。以下是几种常见的更换pip源的方法。
更换pip源的目的是为了提高下载速度,有时我们使用的是国外源,导致下载速度慢,因此可以通过更换pip源来解决。以下提供几种常见的更换pip源的方法。
方法一:在命令行中更换pip源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install pqi
pqi ls
方法三:手动创建配置文件更换pip源
pqi use tuna
[global]timeout = 6000index-url = https://pypi.tuna.tsinghua.edu.cn/simpletrusted-host = pypi.tuna.tsinghua.edu.cn