ssl - 如何解决BAE上部署python-web发生 InsecurePlatformWarning错误而无法下载pip软件包的问题?
PHP中文网
PHP中文网 2017-04-18 10:01:44
0
1
763

报错信息如下:

失败原因:编译失败
失败信息: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安装又会报错,如何解决?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
伊谢尔伦

This problem is often encountered in old Python. It is probably more difficult to control in BAE. It seems that only the requirements.txt installation method is provided.

pip uses the urllib3 library when installing modules from https sources. The ssl module before python2.7.9 is relatively old and will cause some security issues with SSL connections [1].
There are two ways to directly solve this problem:

  1. Upgrade Python to above 2.7.9

  2. Install the security dependencies of urllib3【2】

    >> pip install pyopenssl ndg-httpsclient pyasn1
    

In addition, you can directly use the http source to avoid this problem, such as:

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

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!