14

While trying to launch pgAdmin4, I receive the following error:

Failed to launch pgAdmin4. Error:
Error: spawn /usr/pgadmin4/venv/bin/python3 ENOENT

This is the runtime environment:

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

How can I fix this issue?

matigo
  • 24,860

9 Answers9

8

I encountered the same problem after upgrading from Ubuntu 20.04 to 22.04. Laurenz Albe's answer to simply reinstall PGAdmin 4 resolved the issue in my case. A downgrade from Python 3.10 to Python 3.9 was not necessary.

Jessy
  • 81
4

I have handle the error to switch pyhton3.10 to python3.9 and error fixed.

Just track the steps:

Install python3.9

Switch 3.10 to 3.9

You can use the link to do these steps.

https://www.how2shout.com/linux/install-python-3-9-or-3-8-on-ubuntu-22-04-lts-jammy-jellyfish/

or you just should reinstall pgAdmin4.

3

In my case after upgrading from Ubuntu 20.04 to 22.04, I found that the symbolic link to python whas broken.

To fix that I removed the link and create a new one to the correct path.

sudo ln -s /path/to/python3.8 /usr/pgadmin4/venv/bin/python3

To know where is python3.8 you can do which python3.8, or posibly simply which python

Maske
  • 131
  • 5
1

I faced the same trouble after updating Ubuntu from 22.10 to 23.04.

My winner set of steps was:

  • remove pgadmin.
  • go to pgadmin's web site and setup the repository for my new Ubuntu.
# Install the public key for the repository (if not done previously):
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg

Create the repository configuration file:

sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'

  • Install pgadmin

sudo apt install pgadmin4

Geo
  • 11
  • Happened to me too when upgrading from 22.10 to 23.04. I only needed to do sudo apt remove pgadmin4-desktop pgadmin4-server and then reinstall them back - that's it. I initially was worried it will remove the settings and stored DB connections, but everything stayed the same. There was also no need to install the public key, since I already had it from before. – Alexey Zagalsky Jun 21 '23 at 19:04
0

In my case i just needed to update the source of pgadmin4 to specific for my Ubuntu version in Software & Updates > Other Software from https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/impish/ to https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy/

  • this helped, also after a normal upgrade it was still broken, so had to do the following to fix it: sudo apt install pgadmin4-desktop pgadmin4-server --reinstall – AmanicA Jan 20 '24 at 17:31
0

I faced this issue when I updated the packages after upgrading to Ubuntu 22.04

Save your time and simply reinstall pgAdmin 4

Link to official doc and follow the simple steps (mentioned at the bottom)

provks
  • 23
0

In /usr/pgadmin/venv/bin there are broken shortcuts to python files in /usr/bin/, more precise to python3.8 and python (in my case). To fix these broken links, I just installed python3.8 with the command:

sudo apt install python3.8 

And everything works fine now. Apparently, pgadmin4 looks for these 2 packages and the error occurs because it cannot find them.

Filip
  • 1
0

Notice the error after running: sudo python3 /usr/pgadmin4/web/pgAdmin4.py

In my case, it failed to launch pgadmin 4 because Flask was missing.

0

When I faced the same error, I reinstalled the pgadmin setup.

First remove the existing setup:

sudo apt remove pgadmin4-server
sudo apt remove pgadmin4-desktop
sudo apt remove pgadmin4-web

Then follow the instructions from this page:

Note: I noticed that it will work when we NOT skip any of the following commands. (Yes, you can choose form desktop or Web, but do use the specific installation commands after installing pgadmin4.):

  1. pgadmin4 (sudo apt install pgadmin4)
  2. pgadmin4-desktop (sudo apt install pgadmin4-desktop)
  3. pgadmin4-web (sudo apt install pgadmin4-web)