Ale*_*exM 8 python pip python-3.x python-3.7
我正在继续:
Amazon Linux AMI 2018.03.0
Linux ip-xxx-yy-z-ww 4.14.77-70.59.amzn1.x86_64 #1 SMP Mon Nov 12 22:02:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
多python环境。它同时安装了Python 2.7.15和3.7.2。
常规(Python2)pip正常运行。
当我尝试运行时pip3 install flask,出现以下错误:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flask/
Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flask/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Run Code Online (Sandbox Code Playgroud)
如果我尝试安装其他任何软件包,也会出现相同的错误。
pip3版本是18.1
添加--trusted-host pypi.org无济于事。
安装ca证书无济于事
根据以下指南安装了Python 3:https : //stackoverflow.com/a/8112006/8826349
编辑:我现在注意到,make在Python 3上运行时,它成功完成,但是显示以下消息:
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_hashlib _ssl _tkinter
_uuid
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc atexit pwd
time
Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
Run Code Online (Sandbox Code Playgroud)
编辑2:
我的问题似乎与此相同。但是,该线程除了描述问题外没有提供任何解决方案。
我已尝试使用本指南编译新版本的openssl 。但是较新的openssl版本无法解决我的问题。
编辑3:
我无法找到此问题的解决方案。
看来Amazon的Linux版本无法在Python 3上正常运行。
他们确实有一个不同的操作系统,称为Amazon Linux 2,在其中安装Python 3就像运行一样容易 yum install python3
但是,Amazon Linux 2有其自身的问题。这是缺少Python 2的安装pip。您可以通过运行以下命令手动安装它:
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
Run Code Online (Sandbox Code Playgroud)
但这实际上会覆盖pip3,因此Python 3仍然没有pip。
| 归档时间: |
|
| 查看次数: |
6540 次 |
| 最近记录: |