
我在伺服器上安裝 Flask 時遇到問題。
$ sudo pip3 install flask
Collecting flask
From cffi callback <function _verify_callback at 0x7f2798df7840>:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 309, in wrapper
_lib.X509_up_ref(x509)
AttributeError: module 'lib' has no attribute 'X509_up_ref'
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
我已經升級並更新了 pip:
$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)
Debian 版本:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
Python版本:
$ python3 --version
Python 3.5.3
我相信主要錯誤與 lib 模組有關,正如您在錯誤代碼中看到的那樣,但我不知道如何解決它。
關於出了什麼問題以及如何解決它有任何線索嗎?
答案1
如果可能的話,我會先嘗試從 Debian 儲存庫安裝 python 模組,例如 Flask,然後再嘗試使用pip
.例如,Flash 在 Debian 9 中可用:包python3-flask
。
apt install python3-flask