Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save auvipy/6f05657ad6186fa4c7e4c1eb1f8a83a7 to your computer and use it in GitHub Desktop.
Save auvipy/6f05657ad6186fa4c7e4c1eb1f8a83a7 to your computer and use it in GitHub Desktop.
Install pgAdmin4 with python3 on Ubuntu 16.04

Install pgAdmin4 with python3 on Ubuntu 16.04

  1. Get source code pgAdmin4

     wget https://ftp.postgresql.org/pub/pgadmin3/pgadmin4/v1.0/source/pgadmin4-1.0.tar.gz
    
  2. Unpack pgadmin4-1.0.tar.gz in home dir

     tar xvzf pgadmin4-1.0.tar.gz -C ~/
    
  3. Install pip3

     sudo apt install python3-pip
    
  4. Install virtualenv

     sudo pip3 install virtualenv
    
  5. Create virtualenv in dir ~/py3-venv-pgadmin

     virtualenv --system-site-packages --no-setuptools --python=python3.5 ~/py3-venv-pgadmin
    
  6. Activate virtualenv

     cd ~/py3-venv-pgadmin/bin
     source activate
    
  7. Check pip3

     which pip3
     ~/py3-venv-pgadmin/bin/pip3
    
  8. Install libpq-dev

     sudo apt install libpq-dev
    
  9. Install requrements for python 3

     cd ~/pgadmin4-1.0
     pip3 install -r requirements_py3.txt
    
  10. Install qt-sdk

    sudo apt install qt-sdk
    
  11. Build the runtime

    cd ~/pgadmin4-1.0/runtime
    qmake
    make
    
  12. For desktop deployment

    cd ~/pgadmin4-1.0/web
    touch config_local.py
    nano config_local.py
    

write:

    SERVER_MODE = False

run:

    python3 setup.py
  1. Run pgAdmin4

    python3 pgAdmin4.py
    
  2. Exit virtualenv

    deactivate
    
  3. Remove qt-sdk

    apt purge qt-sdk
    
  4. For run pgadmin4 create script ~/pgadmin4-1.0/pgadmin4.sh

    #!/usr/bin/env bash
    cd ~/py3-venv-pgadmin/bin
    source activate
    python3 ~/pgadmin4-1.0/web/pgAdmin4.py
    

screenshot pgAdmin4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment