A move to solve the python pip install the library installation fails
PIP python is a powerful tool for the installation, but we often have problems installing the library fail, I think the most effective solution:
1. Open https://www.lfd.uci.edu/~gohlke/pythonlibs website,
2. The name of the library search (CTRL + F) to be installed, such as pandas
3. Locate the system and their corresponding version downloaded, when the latter cp Python digital version, such as version python3.6 cp36 representatives, the latter showing 32 32/64 WIN numbers or 64-bit system;
4. When the download using a file path name pip install + installation, e.g.
pip install c:\pandas‑0.23.4‑cp36‑cp36m‑win_amd64.whl
When the processing method is not successful installation pip install
I installed pymysql, how can not be installed successfully:
Install with pip install pymysql:
总是出现错误:Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000238CE8677B8>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/pymysql/
Unsuccessful, I try to install a conda install pymysql:
Or unsuccessful, and try to use python -m pip install pymysql installation:
Finally found actually slow network, to be installed package can not be successfully downloaded caused.
Solution:
pip install pymysql -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
这些安装的数据包好几个网站都有镜像:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
使用方法很简单,直接 -i 加 url 即可!如下:
pip install web.py
-
i http:
/
/
pypi.douban.com
/
simple
或者
pip install web.py -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
也可以把这些包源设置成默认的,方法是修改pip.ini文件的配置:比如
-
[
-
index-url = http: //pypi.douban.com/simple
-
[
-
trusted-host=pypi.douban.com