diff --git a/_posts/help/1970-01-01-pypi.md b/_posts/help/1970-01-01-pypi.md index 007fe14..7075bc3 100644 --- a/_posts/help/1970-01-01-pypi.md +++ b/_posts/help/1970-01-01-pypi.md @@ -18,12 +18,11 @@ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package ### 设为默认 -修改 `~/.config/pip/pip.conf` (Linux), `%APPDATA%\pip\pip.ini` (Windows 10) 或 `$HOME/Library/Application Support/pip/pip.conf` (macOS) (没有就创建一个), 修改 -`index-url`至tuna,例如 +升级 pip 到最新的版本 (>=10.0.0) 后进行配置: ``` -[global] -index-url = https://pypi.tuna.tsinghua.edu.cn/simple +pip install pip -U +pip config set gloabl.index-url https://pypi.tuna.tsinghua.edu.cn/simple ``` -pip 和 pip3 并存时,只需修改 `~/.pip/pip.conf`。 +