安装安装包
# sudo apt-get install build-essential libssl-dev libffi-dev libgmp3-dev virtualenv python-pip libpq-dev python-dev
创建虚拟环境
cd /opt/
mkdir enviromentpy
cd enviromentpy/
virtualenv pgadmin4
cd pgadmin4
source bin/activate
下载并安装PGAdmin 4
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.3/pip/pgadmin4-1.3-py2.py3-none-any.whl
pip install pgadmin4-1.3-py2.py3-none-any.whl
创建PGAdmin 4的本地配置文件
#cd /lib/python2.7/site-packages/pgadmin4 # touch config_local.py
cd /usr/local/lib/python2.7/dist-packages/pgadmin4
touch config_local.py
编辑config_local.py并添加任何所需的配置选项本文所有的软件都可以在《linux就该这么学》这本教材里获得!(使用config.py文件作为参考 - config_local.py中重复的任何设置将覆盖config.py中的设置)。 要将PGAdmin 4配置为在单用户模式下运行,请添加以下行:
# echo "SERVER_MODE = False" >> lib/python2.7/site-packages/pgadmin4/config_local.py
echo "SERVER_MODE = False" >> ./config_local.py
5
运行PGAdmin 4
# python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py . Enter the email address and password to use for the initial pgAdmin user account: Email address: lotfi@yallalabs.com
python /usr/local/lib/python2.7/dist-packages/pgadmin4/pgAdmin4.py
您将提示它添加一个电子邮件地址和密码来访问PGAdmin 4,现在访问http:// localhost:5050并连接您的PostgreSQL服务器。