Use cmd command python -m pip install --upgrade pip update failed
Solution: let PIP source use domestic mirror
Commonly used pip source:
Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple Alibaba
Cloud
: http://mirrors.aliyun.com/pypi/simple/Douban: http://pypi.douban.com/ simple /
更新 pip
python -m pip install --upgrade pip -i https://pypi.douban.com/simple
Use pip sources to install and update third-party libraries
Temporary use method
When entering on the command line, add -i and mirror address to the original command.
Take installing numpy library as an example
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
Permanent use (replace with domestic source)
- Create pip folder under C: / users / administrator file
- Create a text file named pip in the pip folder ( suffix name changed from ".txt" to ".ini" )
- Enter the following code in C: /users/administrator/pip/pip.ini file and save
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
You
can quickly install the jieba library by directly typing in the cmd command line and typing pip install jieba