Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save saltyfireball/e7f1ab561bcbf94e00b9a3ac270ea14a to your computer and use it in GitHub Desktop.

Select an option

Save saltyfireball/e7f1ab561bcbf94e00b9a3ac270ea14a to your computer and use it in GitHub Desktop.
Install pgAdmin4 v3.6 on Ubuntu 18.04 w/python 3.6 using DESKTOP mode

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

@Nitish3793
Copy link

source ~/.zshrc
is giving error : bash: source: /home/nitish/: is a directory

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