如何解决BAE上部署python-web发生 InsecurePlatformWarning错误而无法下载pip软件包的问题?

发布于 2022-09-04 05:54:13 字数 2884 浏览 15 评论 0

报错信息如下:

失败原因:编译失败
失败信息:Fix depends failed. Please check requirements.txt or package.json.

cmdoptions.check_install_build_global(options)
/home/bae/code/helios/deps/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/home/bae/code/helios/deps/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/home/bae/code/helios/deps/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
DEPRECATION: Failed to find 'django' at https://pypi.mirrors.ustc.edu.cn/simple/django/. It is suggested to upgrade your index to support normalized names as the name in /simple/{name}.
/home/bae/code/helios/deps/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Cannot fetch index base URL https://pypi.mirrors.ustc.edu.cn/simple/
/home/bae/code/helios/deps/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Could not find a version that satisfies the requirement django==1.10.3 (from -r /home/bae/run/baeng/helios/work/appid9f0jy29yct/requirements.txt (line 1)) (from versions: )
No matching distribution found for django==1.10.3 (from -r /home/bae/run/baeng/helios/work/appid9f0jy29yct/requirements.txt (line 1))

百度这个问题说要解决需要安装openssl等软件包,但是通过SSH连接服务器我没有权限无法安装,而通过requirements.txt安装又会报错,如何解决?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骷髅 2022-09-11 05:54:13

这个问题在老的Python中经常遇到,在BAE中估计比较难控制,貌似只提供了requirements.txt安装的方式。

pip从https源安装模块时使用urllib3这个库,在python2.7.9之前的ssl模块比较老,会导致一些SSL连接的安全问题【1】。
直接解决这个问题有两个方法:

  1. 升级Python到2.7.9之上

  2. 安装urllib3的安全依赖【2】

    >> pip install pyopenssl ndg-httpsclient pyasn1
    

另外可以直接使用http的源来避开这个问题,如:

  >> pip install django==1.10.3 -i http://pypi.douban.com/simple

【1】https://urllib3.readthedocs.i...
【2】https://urllib3.readthedocs.i...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文