尝试启动 pgAdmin4 时,我收到以下错误:
Failed to launch pgAdmin4. Error:
Error: spawn /usr/pgadmin4/venv/bin/python3 ENOENT
这是运行时环境:
Python Path: "/usr/pgadmin4/venv/bin/python3"
Runtime Config File: "/home/julien/.config/pgadmin/runtime_config.json"
pgAdmin Config File: "/usr/pgadmin4/web/config.py"
Webapp Path: "/usr/pgadmin4/web/pgAdmin4.py"
pgAdmin Command: "/usr/pgadmin4/venv/bin/python3 -s /usr/pgadmin4/web/pgAdmin4.py"
Environment:
- GJS_DEBUG_TOPICS: JS ERROR;JS LOG
- LC_TIME: fr_FR.UTF-8
- USER: julien
- XDG_SESSION_TYPE: wayland
- SHLVL: 0
- HOME: /home/julien
- OLDPWD: /home/julien
- DESKTOP_SESSION: ubuntu
- GIO_LAUNCHED_DESKTOP_FILE: /usr/share/applications/pgadmin4.desktop
- GTK_MODULES: gail:atk-bridge
- GNOME_SHELL_SESSION_MODE: ubuntu
- LC_MONETARY: fr_FR.UTF-8
- MANAGERPID: 2723
- DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
- GIO_LAUNCHED_DESKTOP_FILE_PID: 409396
- WAYLAND_DISPLAY: wayland-0
- LOGNAME: julien
- _: /usr/bin/gnome-session
- rvm_bin_path: /usr/share/rvm/bin
- JOURNAL_STREAM: 8:37688
- XDG_SESSION_CLASS: user
- USERNAME: julien
- GNOME_DESKTOP_SESSION_ID: this-is-deprecated
- PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/share/rvm/bin
- SESSION_MANAGER: local/sunchain:@/tmp/.ICE-unix/2935,unix/sunchain:/tmp/.ICE-unix/2935
- INVOCATION_ID: b0a4bd7f387b4b94b2d1ad6290b4faa6
- LC_ADDRESS: fr_FR.UTF-8
- XDG_RUNTIME_DIR: /run/user/1000
- XDG_MENU_PREFIX: gnome-
- GNOME_SETUP_DISPLAY: :1
- DISPLAY: :0
- LANG: en_US.UTF-8
- LC_TELEPHONE: fr_FR.UTF-8
- XDG_CURRENT_DESKTOP: ubuntu:GNOME
- XDG_SESSION_DESKTOP: ubuntu
- XMODIFIERS: @im=ibus
- XAUTHORITY: /run/user/1000/.mutter-Xwaylandauth.OGNI80
- SSH_AGENT_LAUNCHER: gnome-keyring
- SSH_AUTH_SOCK: /run/user/1000/keyring/ssh
- LC_NAME: fr_FR.UTF-8
- SHELL: /usr/bin/zsh
- QT_ACCESSIBILITY: 1
- GDMSESSION: ubuntu
- rvm_prefix: /usr/share
- LC_MEASUREMENT: fr_FR.UTF-8
- LC_IDENTIFICATION: fr_FR.UTF-8
- rvm_version: 1.29.12 (manual)
- GJS_DEBUG_OUTPUT: stderr
- QT_IM_MODULE: ibus
- PWD: /home/julien
- XDG_DATA_DIRS: /usr/local/share/:/usr/share/:/var/lib/snapd/desktop
- LC_NUMERIC: fr_FR.UTF-8
- LC_PAPER: fr_FR.UTF-8
- rvm_path: /usr/share/rvm
- GDK_BACKEND: x11
- NO_AT_BRIDGE: 1
- PGADMIN_INT_PORT: 34035
- PGADMIN_INT_KEY: dbb4e565-1e23-474d-bd74-c3d8606022cc
- PGADMIN_SERVER_MODE: OFF
我该如何修复此问题?
答案1
从 Ubuntu 20.04 升级到 22.04 后,我遇到了同样的问题。Laurenz Albe 的回答只需重新安装 PGAdmin 4 即可解决我的问题。无需从 Python 3.10 降级到 Python 3.9。
答案2
我已经处理了将 pyhton3.10 切换到 python3.9 的错误并且错误已修复。
只需跟踪以下步骤:
Install python3.9
Switch 3.10 to 3.9
您可以使用链接执行这些步骤。
https://www.how2shout.com/linux/install-python-3-9-or-3-8-on-ubuntu-22-04-lts-jammy-jellyfish/
或者您应该重新安装 pgAdmin4。
答案3
就我的情况而言,从 Ubuntu 20.04 升级到 22.04 后,我发现到 python 的符号链接已损坏。
为了解决这个问题,我删除了该链接并创建了一个指向正确路径的新链接。
sudo ln -s /path/to/python3.8 /usr/pgadmin4/venv/bin/python3
要知道 python3.8 在哪里,你可以这样做which python3.8
,或者可能只是which python
答案4
就我而言,我只需要将 pgadmin4 的源更新为特定的对于我的 Ubuntu 版本在软件和更新 > 其他软件中从https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/impish/
到https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy/