记录一次pip安装不了包(换源也不得行)
1.使用阿里云。安装不成功
(.venv) PS E:\python项目\路飞学院> pip install scrapy==2.5.1 -i http://mirrors.aliyun.com/pypi/simple/
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
ERROR: Could not find a version that satisfies the requirement scrapy==2.5.1 (from versions: none)
ERROR: No matching distribution found for scrapy==2.5.1
2.使用清华源也不得行
(.venv) PS E:\python项目\路飞学院> pip install scrapy==2.5.1
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting scrapy==2.5.1ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages/22/26/497ef936b54ae00e24694934cb25d524061722bb0d8582da33430e3e7608/Scrapy-2.5.1-py2.py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/scrapy/) (requires-python:>=3.6)
ERROR: Could not install requirement scrapy==2.5.1 from https://pypi.tuna.tsinghua.edu.cn/packages/22/26/497ef936b54ae00e24694934cb25d524061722bb0d8582da33430e3e7608
/Scrapy-2.5.1-py2.py3-none-any.whl because of HTTP error 403 Client Error: Forbidden for url: https://pypi.tuna.tsinghua.edu.cn/packages/22/26/497ef936b54ae00e246949
34cb25d524061722bb0d8582da33430e3e7608/Scrapy-2.5.1-py2.py3-none-any.whl for URL https://pypi.tuna.tsinghua.edu.cn/packages/22/26/497ef936b54ae00e24694934cb25d524061722bb0d8582da33430e3e7608/Scrapy-2.5.1-py2.py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/scrapy/) (requires-python:>=3.6)
3.点击清华源访问地址:出现下面的问题。
我们检测到您所在的子网和/或所使用的客户端存在大量下载某些较大二进制文件的行为,为保证用户的正常使用,我们阻断了此类请求。
4.解决方法:挂个全局代理切换本地的ip即可访问清华源镜像,
可能等一段时间限制没有了应该就可以下载了把(没试)
5.能正常下载
(.venv) PS E:\python项目\路飞学院> pip install scrapy==2.5.1
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting scrapy==2.5.1Downloading https://pypi.tuna.tsinghua.edu.cn/packages/22/26/497ef936b54ae00e24694934cb25d524061722bb0d8582da33430e3e7608/Scrapy-2.5.1-py2.py3-none-any.whl (254 kB)
......
Successfully installed PyDispatcher-2.0.7 Twisted-24.7.0 attrs-24.2.0 automat-24.8.1 cffi-1.17.0 constantly-23.10.4 cryptography-43.0.0 cssselect-1.2.0 h2-3.2.0 hpac
k-3.0.0 hyperframe-5.2.0 hyperlink-21.0.0 incremental-24.7.2 itemadapter-0.9.0 itemloaders-1.3.1 jmespath-1.0.1 lxml-5.3.0 packaging-24.1 parsel-1.9.1 priority-1.3.0protego-0.3.1 pyOpenSSL-24.2.1 pyasn1-0.6.0 pyasn1-modules-0.4.0 pycparser-2.22 queuelib-1.7.0 scrapy-2.5.1 service-identity-24.1.0 typing-extensions-4.12.2 w3lib-2.2.1 zope.interface-7.0.3