Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
源码编译安装pgadmin4 平台
Apps Section
1615
views ·
4
replies ·
To
floor
Go
b***j@126.com
deepin
2018-07-31 03:02
Author
本人用了几天时间,终于将pgAdmin4.3.1安装成功了。步骤整理如下,供参考。
平台:
Deepin
x86_64
15.6
1、
查看
Python版本:
$
python -V
若是
2.7版本,请先升级至3.5版本。
下载
Python 3.5版本:
$cd /home/zuoyh/Downloads
$sudo wget
https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
解压:
$sudo tar -zxvf Python-3.5.2.tgz
$cd Python-3.5.2 #进解压目录
$./configure
编译
(编译时间较长):$ sudo make
安装:
$sudo make install
设置
3.
5.2
为默认版本
查看
Python 的路径,在 /usr/bin 下面。可以看到 python 链接的是 python 2.7,所以,执行 python 就相当于执行 python 2.7。
将原来
python 的软链接重命名:
$sudo
mv /usr/bin/python /usr/bin/python.bak
将
python 链接至 python3:
$sudo
ln -s /usr/local/bin/python3 /usr/bin/python
查看版本:
$python -V
2、
去
postgresql官网
下载
.whl包
(下载后不必解压)
$sudo
wget
h
ttps://ftp.postgresql.org/pub/pgadmin/pgadmin4/v3.1/pip/pgadmin4-3.1-py2.py3-none-any.whl
3
、编译
安装
使用
pip安装pgadmin4:
$cd /home/zuoyh/Downloads/
确保已经安装了
Pyhont3的pip3
$ sudo apt install python3-pip
$pip3 install pgadmin4-3.1-py2.py3-none-any.whl
默认安装路径是:
/usr/local/lib/python3.5/dist-packages/pgadmin4
$
cd /usr/local/lib/python3.5/dist-packages/pgadmin4
$
pip3 install flask-login
$
p
ip
3
install flask_babel
4、
运行
pgAdmin4
$
python3 pgAdmin4.py
使用上述命令运行
pgAdmin4
,开始时会出现许多次报错,这是缺少安装包所致!
$pip3 install flask
$pip3 install flask-login
$pip3 install flask_babel
$pip3 install flask_security
$apt-get install libapache2-mod-wsgi-py3
$apt-get install openssl*
$pip3 install libssl-dev
$pip3 install distribute
$pip3 install setuptools
$sudo apt-get install sqlite3
$sudo apt-get install libsqlite3-dev
安装包加载后,需要重新编译安装
Python3.5.2。这个过程可能会重复几次,直到正常启动。
$
python
3
setup.py(设置登陆 pgAdmin4的用户名/密码)
运行
$
python
3
pgAdmin4.py
5
、打开浏览器
http://127.0.0.1:5050/browser/
(若需要深入探讨,请加入QQ群161968030)
Reply
Like 0
Favorite
View the author
All Replies
b***j@126.com
deepin
2018-07-31 03:12
#1
使用sudo apt-get install pgadmin只能安装pgadmin3,PostgreSQL11beta2只能使用pgAdmin4进行管理。
Reply
Like 0
View the author
BingoLove
deepin
2018-07-31 03:25
#2
本帖最后由 BingoLove 于 2018-7-30 19:28 编辑
关于Python
Python2跟Python3不是简单的升级
deepin默认装了Python3的。不要自己把Python2升级成Python3,使用的时候python3就是启动Python3
自己手动安装python3很容易搞坏系统。有些软件是依赖python2的。
Reply
Like 0
View the author
b***j@126.com
deepin
2018-07-31 04:01
#3
多谢3#BingoLove提醒,我会注意
Reply
Like 0
View the author
b***j@126.com
deepin
2018-07-31 04:05
#4
https://bbs.deepin.org/post/144543#
切换python2至puthon3吧
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
【Enhanced Repo】Better Deepin Repo is released
Popular Events
More