Usually the reason for this situation is that the network connection is wrong, because you need to connect to the external network. At this time, the domestic network speed is very slow, so you need to use some domestic mirror sources to download.
Enter the pip update command in the cmd command terminal:
python -m pip install --upgrade pip https://pypi.tuna.tsinghua.edu.cn/simple/
But do you have to follow a mirror URL every time you use pip? You can also choose not, then you need to configure python to install pip default image . Here we choose the image source of Tsinghua University as an example:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
It can be done in one step.
If you are not at ease, you can use the following command to check whether it has been replaced in the terminal:
pip config list
Common domestic mirror sites:
watercress mirror
http://pypi.douban.com/simple
Ali Cloud
http://mirrors.aliyun.com/pypi/simple/
Mirror image of Tsinghua University
https://pypi.tuna.tsinghua.edu.cn/simple/
University of Science and Technology Mirror
https://pypi.mirrors.ustc.edu.cn/simple/