Skip to content

Instantly share code, notes, and snippets.

@mildcore
Last active April 21, 2020 02:14
Show Gist options
  • Save mildcore/04448d2524144ab1df8bc99c41588340 to your computer and use it in GitHub Desktop.
Save mildcore/04448d2524144ab1df8bc99c41588340 to your computer and use it in GitHub Desktop.

1. pip basic use

upgrade:
python -m pip install --upgrade pip setuptools wheel
while pip unreachable/uninstalled:
python -m ensure pip
while pip upgrade itself failed:
remove the directory like "\Lib\site-packages\pip-20.0.2.dist-info"

2. mirrors to speed up:

mirror setting:

<1> -i for temporarily use
pip install pip -U -i https://pypi.tuna.tsinghua.edu.cn/simple
<2> pip config
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
<3> file config

Windows: ~/pip/pip.ini Linux: ~/.pip/pip.conf

[global]
index-url=https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment