skip to Main Content

I have followed this tutorial for installing pgadmin4-web: pgAdmin 4 (APT) .

When I run the following command

sudo /usr/pgadmin4/bin/setup-web.sh 

I get the following error:

Setting up pgAdmin 4 in web mode on a Debian based platform… Creating
configuration database… /usr/pgadmin4/bin/setup-web.sh: line 75:
/usr/pgadmin4/venv/bin/python3: No such file or directory Error
setting up server mode. Please examine the output above.

Any help would be great thanks.

Note:

After run the following command (tutorial´s step two)

sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'

I had to change inside file /etc/apt/sources.list.d/pgadmin4.list from jammy to bionic

from
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 main
to
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bionic pgadmin4 main

6

Answers


  1. I managed to install pgadmin4 from APT on Ubuntu 22.04, but even after that I was facing some issues while starting pgadmin4.

    So I found out that there’s a python package for pgadmin4 which exists. It will install the web version of the pgadmin4 and it works without any issue.

    Follow the below steps to install or you can check this link.

    $ sudo mkdir /var/lib/pgadmin
    $ sudo mkdir /var/log/pgadmin
    $ sudo chown $USER /var/lib/pgadmin
    $ sudo chown $USER /var/log/pgadmin
    
    # Create virtual environment
    $ python3 -m venv pgadmin4
    $ source pgadmin4/bin/activate
    
    # Install pgadmin4
    (pgadmin4) $ pip install pgadmin4
    
    # Start pgadmin4
    (pgadmin4) $ pgadmin4
    

    For the first time after running pgadmin4, you’ll be asked to set the email and password.

    Login or Signup to reply.
  2. Adding to what Shashank outlined using PGAdmin Python virtual environment and run thru web browser.

    1. Follow guidance here
    2. To re-start PGAdmin, from terminal run
    $ source pgadmin4/bin/activate
    $ pgadmin4
    1. Navigate to http://127.0.0.1:5050 in browser (keep terminal open)
    Login or Signup to reply.
  3. You can also use Docker to install pgadmin4 on Ubuntu 22.04:

    docker pull dpage/pgadmin4
    docker run -p 80:80 
        -e '[email protected]' 
        -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' 
        -d dpage/pgadmin4
    

    To install docker: https://docs.docker.com/engine/install/ubuntu/

    Documentation for container deployment: https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html#examples

    Login or Signup to reply.
  4. I had a similar problem and couldn’t find any solution for the desktop version, in particular, for Ubuntu 22.04 (jammy). However, this should also work for the pgadmin4-web:

    sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
    sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2022-05-05/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
    sudo apt install pgadmin4-web
    

    (Don’t forget to run sudo /usr/pgadmin4/bin/setup-web.sh after that)

    For the desktop version just install pgadmin4-desktop instead of pgadmin4-web:

    sudo apt install pgadmin4-desktop
    

    Also, please note that this is a temporary solution (May 2022), until the devs release the final pgadmin4 version for jammy. Once it’s out, you would just need to update the repository.

    Hope this helps.

    Login or Signup to reply.
  5. I found the solution to this problem and is necessary to install python3.8 in the new OS Linux versions has python3.10.

    Install Python3.8

    Run the following commands as root or user with sudo access to update the packages list and install the prerequisites:

    sudo apt update

    sudo apt install software-properties-common

    Add the deadsnakes PPA to your system’s sources list:

    sudo add-apt-repository ppa:deadsnakes/ppa

    • When prompted press Enter to continue:

      Press [ENTER] to continue or Ctrl-c to cancel adding it.

    Once the repository is enabled, install Python 3.8 with:

    sudo apt install python3.8

    Verify that the installation was successful by typing:

    python3.8 –version

    Python 3.8.0
    

    Run finally

    sudo /usr/pgadmin4/bin/setup-web.sh

    Setting up pgAdmin 4 in web mode on a Debian based platform...
    Creating configuration database...
    NOTE: Configuring authentication for SERVER mode.
    
    Enter the email address and password to use for the initial pgAdmin user account:
    
    Login or Signup to reply.
  6. TL;DR;

    For some reason installing just pgadmin4-web or pgadmin4-desktop does NOT install pgadmin4-server and you need first to install it like (for desktop):

    sudo apt install pgadmin4-server pgadmin4-desktop

    Long(er) version:

    After upgrading to Ubuntu 22.04 (from 20.04) pgAdmin stopped working. There were some problems with older python version (3.8), tried to fix them in various ways but at the end gave up and just purged pgadmin4. After installing just pgadmin4-desktop package (which depends on pgadmin4 package) I found out that the installation is not full, i.e. missing files and dirs from /usr/pgadmin4. After installing the pgadmin4-server package everything started to work as expected. Hope this helps someone because I’ve wasted several hours investigating this gd issue.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search