在 localhost:5000 中,脚本运行时没有任何错误,但是当涉及到符号链接时,错误已被抛出到 appache 日志中。
[Sun Jun 10 17:07:16.170057 2018] [wsgi:error] [pid 30438] [client 120.29.113.65:32852] mod_wsgi (pid=30438): Exception occurred processing$
[Sun Jun 10 17:07:16.170435 2018] [wsgi:error] [pid 30438] [client 120.29.113.65:32852] Traceback (most recent call last):
[Sun Jun 10 17:07:16.170461 2018] [wsgi:error] [pid 30438] [client 120.29.113.65:32852] File "/var/www/html/salesappserver/app.wsgi", lin$
[Sun Jun 10 17:07:16.170465 2018] [wsgi:error] [pid 30438] [client 120.29.113.65:32852] from api import app as application
[Sun Jun 10 17:07:16.170471 2018] [wsgi:error] [pid 30438] [client 120.29.113.65:32852] File "/var/www/html/salesappserver/api.py", line $
[Sun Jun 10 17:07:16.170474 2018] [wsgi:error] [pid 30438] [client 120.29.113.65:32852] from flask_jwt_extended import JWTManager
[Sun Jun 10 17:07:16.170491 2018] [wsgi:error] [pid 30438] [client 120.29.113.65:32852] ImportError: No module named 'flask_jwt_extended'
[Sun Jun 10 17:07:17.501917 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] mod_wsgi (pid=30439): Target WSGI script '/var/www/$
[Sun Jun 10 17:07:17.501994 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] mod_wsgi (pid=30439): Exception occurred processing$
[Sun Jun 10 17:07:17.502345 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] Traceback (most recent call last):
[Sun Jun 10 17:07:17.502372 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] File "/var/www/html/salesappserver/app.wsgi", lin$
[Sun Jun 10 17:07:17.502376 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] from api import app as application
[Sun Jun 10 17:07:17.502382 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] File "/var/www/html/salesappserver/api.py", line $
[Sun Jun 10 17:07:17.502393 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] from flask_jwt_extended import JWTManager
[Sun Jun 10 17:07:17.502411 2018] [wsgi:error] [pid 30439] [client 120.29.113.65:32858] ImportError: No module named 'flask_jwt_extended'
这是主要问题:
导入错误:没有名为“flask_jwt_extended”的模块
我已经满足FLASK中的要求了
(salesappserver) ubuntu@ip-172-31-3-35:~$ pip install flask-jwt-extended
Requirement already satisfied: flask-jwt-extended in ./salesappserver/lib/python3.6/site-packages (3.10.0)
Requirement already satisfied: Flask in ./salesappserver/lib/python3.6/site-packages (from flask-jwt-extended) (1.0.2)
Requirement already satisfied: PyJWT in ./salesappserver/lib/python3.6/site-packages (from flask-jwt-extended) (1.6.4)
Requirement already satisfied: Werkzeug>=0.14 in ./salesappserver/lib/python3.6/site-packages (from flask-jwt-extended) (0.14.1)
Requirement already satisfied: Jinja2>=2.10 in ./salesappserver/lib/python3.6/site-packages (from Flask->flask-jwt-extended) (2.10)
Requirement already satisfied: itsdangerous>=0.24 in ./salesappserver/lib/python3.6/site-packages (from Flask->flask-jwt-extended) (0.24)
Requirement already satisfied: click>=5.1 in ./salesappserver/lib/python3.6/site-packages (from Flask->flask-jwt-extended) (6.7)
Requirement already satisfied: MarkupSafe>=0.23 in ./salesappserver/lib/python3.6/site-packages (from Jinja2>=2.10->Flask->flask-jwt-extended) (1.0)
(salesappserver) ubuntu@ip-172-31-3-35:~$
请帮助我。
您缺少
flask-jwt-extended
模块。通过运行以下命令获取包,然后重试。
pip install flask-jwt-extended
如果您想将 python 作为服务运行或不在用户环境中运行,则必须使用软件包安装 apt-get install python3-python-flask-jwt-extended
在 ubuntu 中试试这个:
sudo apt-get update
sudo apt-get install python3-python-flask python3-python-flask-jwt-extended -y
如果你想在 python 2.x 的用户环境中运行
pip install flask flask_jwt_extended
在 python 3.x 中安装如下:
pip3 install flask flask_jwt_extended
由于我在虚拟环境中工作,因此我在 venv 中安装 jwt 扩展,就像任何其他包一样。
真正解决我的问题的是通过在用户cmd中运行命令并将其直接安装在系统中。
pip install flask flask-jwt-extended