当我在 manjaro xfce 中打开 pgadmin4 时,会弹出此错误消息:
初始化 pgadmin 4 服务器时发生错误:无法启动应用程序服务器,服务器线程退出。
我检查了日志
启动日志
2021-08-26 09:35:29: Checking for system tray...
2021-08-26 09:35:29: Starting pgAdmin4 server...
2021-08-26 09:35:29: Creating server object, port:42505, key:fdcf6315-03b8-4a0c-a4cc-c8e6efc3f38e, logfile:/home/thenujan/.local/share/pgadmin4.d41d8cd98f00b204e9800998ecf8427e.log
2021-08-26 09:35:29: Python Path: /usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/lib/python3.9/site-packages
2021-08-26 09:35:29: Python Home: /usr/lib/python3.9
2021-08-26 09:35:29: Initializing Python...
2021-08-26 09:35:29: Python initialized.
2021-08-26 09:35:29: Adding new additional path elements
2021-08-26 09:35:29: Redirecting stderr...
2021-08-26 09:35:29: stderr redirected successfully.
2021-08-26 09:35:29: Initializing server...
2021-08-26 09:35:29: Webapp Path: /usr/lib/pgadmin4/web/pgAdmin4.py
2021-08-26 09:35:29: Server initialized, starting server thread...
2021-08-26 09:35:29: Open the application code and run it.
2021-08-26 09:35:29: Set the port number, key and force SERVER_MODE off
2021-08-26 09:35:29: PyRun_SimpleFile launching application server...
2021-08-26 09:35:30: Failed to launch the application server, server thread exiting.
服务器日志
Traceback (most recent call last):
File "/usr/lib/pgadmin4/web/pgAdmin4.py", line 35, in <module>
import config
File "/usr/lib/pgadmin4/web/config.py", line 25, in <module>
from pgadmin.utils import env, IS_WIN, fs_short_path
File "/usr/lib/pgadmin4/web/pgadmin/__init__.py", line 28, in <module>
from flask_security import Security, SQLAlchemyUserDatastore, current_user
File "/usr/lib/python3.9/site-packages/flask_security/__init__.py", line 15, in <module>
from .core import Security, RoleMixin, UserMixin, AnonymousUser, current_user
File "/usr/lib/python3.9/site-packages/flask_security/core.py", line 48, in <module>
from .mail_util import MailUtil
File "/usr/lib/python3.9/site-packages/flask_security/mail_util.py", line 14, in <module>
import email_validator
ModuleNotFoundError: No module named 'email_validator'
我确实尝试安装 email_validator
通过使用 pip
pip install email_validator
但它仍然向我显示相同的错误
有时它会奇怪地显示无法打开系统默认 Web 浏览器,并且该错误消息在重新启动后停止,然后在多次尝试打开 pgadmin4 后再次出现
并且仅当 pgadmin4 在后台运行时才会弹出此 Web 浏览器错误,如果我杀死 pgadmin4,然后打开它时会弹出无法启动应用程序服务器错误
答案1
解决方案是降级 python-flask 和 python-flask-security-too。它们分别不能超过 2.0 和 4.0。