Skip to content

Instantly share code, notes, and snippets.

@rubinhozzz
Last active August 19, 2023 16:41
Show Gist options
  • Save rubinhozzz/368176fec80edcf449a76e15164ff728 to your computer and use it in GitHub Desktop.
Save rubinhozzz/368176fec80edcf449a76e15164ff728 to your computer and use it in GitHub Desktop.
Install pgAdmin4 (Python wheel)
1. Download last version of Python wheel: https://www.pgadmin.org/download/pgadmin-4-python-wheel/
2. Install wheel
mkdir ~/pgadmin4
cd ~/pgadmin4
python3.X -m venv venv
. venv/bin/activate
pip install pgadmin4-X.X-py2.py3-none-any.whl
3. Create config (this is because you can have a permission error with the default log directory)
vim venv/lib/python3.X/site-packages/pgadmin4/config_local.py
import os
DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))
LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
4. Run pgAdmin4
python ~/pgadmin4/venv/lib/python3.X/site-packages/pgadmin4/pgAdmin4.py
@alsunseri
Copy link

This is great.
Thanks.
Only thing was that I HAD to name the file config_local.py or it was not run/included

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