python模块安装问题:no matching distribution found for XXX 或者 Read timed out.
从国内库源下载,速度快,主要为两个
清华库源 https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣库源 https://pypi.doubanio.com/simple/
也可以在Pycharm中添加
设置超时时间安装:
pip --default-timeout=100 install #包名
pip临时使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
pip永久修改
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip换回默认源
pip config set global.index-url https://pypi.org/simple/
**
关于给python安装.whl文件的一些问题
**先提供下载whl文件的地址:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
下载安装whl文件的流程:
通过Unofficial Windows Binaries for Python Extension Packages下载twisted对应版本的whl文件。
我的为Twisted-18.4.0-cp36-cp36m-win_amd64.whl
注意:cp后面是python版本,amd64代表64位
运行命令:pip install D:\Download\Twisted-18.4.0-cp36-cp36m-win_amd64.whl
注意输入下载的Twisted的正确路径。
安装完成后,再次运行:pip install Scrapy
如果提示NewConnectionError,原因可能是本地包所在路径含中文,比如我这的专门下载文件夹,只用将下载文件换个全英文的路径即可