在pip中提取zip文件时收到403错误

时间:2019-06-04 16:48:39

标签: python apache pip http-status-code-403

我正在使用requirements.txt文件中的网址通过pip安装python软件包:

https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip

运行pip install -r requirements会导致403错误:

(testenv) protopixel@ppxnode-421E2FF:~/proto_light_simulator/snap$ pip install -r requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip (from -r requirements.txt (line 1))
  ERROR: HTTP error 403 while getting https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip
  ERROR: Could not install requirement https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip (from -r requirements.txt (line 1)) because of error 403 Client Error: Forbidden for url: https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip
ERROR: Could not install requirement https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip (from -r requirements.txt (line 1)) because of HTTP error 403 Client Error: Forbidden for url: https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip for URL https://devdownloads.protopixel.net/python_dependencies/pyOSC-0.3.5b-5294.zip

不过,简单的wget可以正常工作。

我对这是点子问题,操作系统相关问题还是服务器配置问题(Apache)感到困惑。关于如何调试的任何见解?

1 个答案:

答案 0 :(得分:0)

让点子完成这项工作。经过测试,在Ubuntu Xenial容器中:

root@9f411ba3b846:/# pip install pyOSC
Collecting pyOSC
  Downloading https://files.pythonhosted.org/packages/7c/e4/6abb118cf110813a7922119ed0d53e5fe51c570296785ec2a39f37606d85/pyOSC-0.3.5b-5294.tar.gz
Building wheels for collected packages: pyOSC
  Running setup.py bdist_wheel for pyOSC ... done
  Stored in directory: /root/.cache/pip/wheels/df/6a/66/769db4893bd6f5b52d1640661f2fcdee9c49b62e4b934b4686
Successfully built pyOSC
Installing collected packages: pyOSC
Successfully installed pyOSC-0.3.5b5294