記錄一次pip安裝不了包(換源也不得行)

随风小屋發表於2024-08-29

記錄一次pip安裝不了包(換源也不得行)

建立時間: 2024 年8月29

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.1
  ERROR: 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.1
  Downloading 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.0
 protego-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

相關文章