Python is too slow and pip install installation error, you get two ways to teach.

Problems
Python when installing the package, you can use the installation pip, this is very convenient.
But often mounted on the error attached, very annoying.

For example, we want to install this package sci.

#在cmd中输入
pip install sci

The installation process in the following figure, oh, the error, red red: the
Here Insert Picture Description
solution to
how to do it?
Two approaches.

Method 1: * (not very recommended)
to copy someone else's whl file, or download from the Internet, and then enter the following code by the cmd.

pip install XXX.whl

whl files can be downloaded via this website
https://www.lfd.uci.edu/~gohlke/pythonlibs/

Here Insert Picture Description
Here Insert Picture Description
Method 2 :(highly recommended

This is because we limit the issue of the external network, the download speed is too slow, error.
Use a mirror image of Tsinghua University, can help you quickly download, speed flying. There are some packages, or even a few seconds can handle that.

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

For example, I want to install sci package.
In cmd, enter:

pip install sci -i https://pypi.tuna.tsinghua.edu.cn/simple 
#相比原始方法,加上这么一段话-i https://pypi.tuna.tsinghua.edu.cn/simple 

Here Insert Picture Description
, I speak with the facts.
Here Insert Picture Description
Successful installation! ! !

Remember this site https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
Here Insert Picture Description

This concludes the article. . .

2020-02-11

Published 85 original articles · won praise 64 · views 10000 +

Guess you like

Origin blog.csdn.net/hahahahhahha/article/details/104267399