PgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL database.
PgAdmin is the leading graphical Open Source management, development and administration tool for PostgreSQL.
In this tutorial, we are going to demonstrate how to run and install PgAdmin 4 v2 in Server Mode as a WSGI application under Apache HTTP, using mod_wsgi on CentOS 7 / RHEL 7.
If you didn’t yet install PostgreSQL take a look the below links :
- How to Install PostgreSQL on Ubuntu 16.04 LTS
- How To Install PostgreSQL 9.6 on CentOS 7 / RHEL 7
- How To Change PostgreSQL Data Directory Location on Ubuntu 16.04
- How To Enable Network Remote Access To PostgreSQL Database Server
- How to install pgAdmin 4 in desktop mode on Ubuntu 16.04 LTS
- How to install pgAdmin 4 in Server mode on Ubuntu 16.04 LTS
- How to install PgAdmin 4 in Server Mode as a Web Application using WSGI on Ubuntu 18.04 LTS / Ubuntu 16.04 LTS
Step 1. Install PGAdmin 4
– To install PgAdmin4 v2, we are going to use the PostgreSQL RPM, use the following command to install the PostgreSQL repository:
# yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm -y # yum install epel-release
– Use the following command to install PgAdmin 4 v2
# yum install pgadmin4-v2
Step 1. Configure PGAdmin 4
– In order to configure pgAdmin to run in server mode properly as a web application, it may be necessary to specify the path of the PgAdmin database, Sessions and Log file. Open config_distro.py file and add the following settings:
# vi /usr/lib/python2.7/site-packages/pgadmin4-web/config_distro.py LOG_FILE = '/var/log/pgadmin4/pgadmin4.log' SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db' SESSION_DB_PATH = '/var/lib/pgadmin4/sessions' STORAGE_DIR = '/var/lib/pgadmin4/storage'
– Run the following command to create the configuration database.
# python /usr/lib/python2.7/site-packages/pgadmin4-web/setup.py NOTE: Configuring authentication for SERVER mode. Enter the email address and password to use for the initial pgAdmin user account: Email address: [email protected] Password:Type the Password Retype password:Retype the Password pgAdmin 4 - Application Initialisation ======================================
– Change the ownership of the configuration database directory to the user Apache:
# chown -R apache:apache /var/lib/pgadmin4 # chown -R apache:apache /var/log/pgadmin4
– If the SeLinux is enabled, adjust the SELinux policy using the following commands:
# chcon -R -t httpd_sys_content_rw_t "/var/log/pgadmin4/" # chcon -R -t httpd_sys_content_rw_t "/var/lib/pgadmin4/"
Step 3. Create the Apache Virtual Host for PGAdmin 4
– Create a new apache virtual host file and add the following lines
# vi /etc/httpd/conf.d/pgadmin4.conf
<VirtualHost *>
ServerName pgadmin.yallalabs.local
WSGIDaemonProcess pgadmin processes=1 threads=25
WSGIScriptAlias / /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi
<Directory "/usr/lib/python2.7/site-packages/pgadmin4-web/">
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
</VirtualHost>
– Use the following command to check the apache configuration:
# apachectl configtest Syntax OK
– Restart Apache by running the below command
# systemctl restart httpd
– To make sure PgAdmin can access to the PostgreSQL server we need to adjust Selinux to allow Apache to connect via network using the following command
# setsebool -P httpd_can_network_connect 1
Step 4. Access PGAdmin 4
– If the Firewall is enabled, execute the following command to enable http service :
# firewall-cmd --permanent --add-service=http # firewall-cmd --reload success
– Open http://pgadmin.yallalabs.local and logon to the PgAdmin using your credentials.
42 comments
Oh, we removed all these steps, and put them inside a single shell script in 2.0 RPMs.
I will blog about this next week.
Hi Devrim Gunduz,
Thanks.
Everything is working perfectly .but when i am excute this line
python /usr/lib/python2.7/site-packages/pgadmin4-web/setup.py
it does not ask the email and password. so. directly go to the databse without asking login.
pl..any one help to solve the issue
Hi Arun,
Delete the /var/lib/pgadmin4 directory that been created after the installation of the PgAdmin 4
Run the Following commands:
# rm -r/var/lib/pgadmin4
## Delete the pgadmin local directory
And reinstall pgAdmin4. If you have any problems we are happy to assist you.
Thank you for your Reply., it is perfectly running. thank you so much. your blog is very much useful for us
Website showing Internal Server error on Centos7
Hi hussnain,
Could u please check the httpd logs and pgadmin logs like this ee can help you.
Hi Waderni,
Thank you for your reply.
Below are the pgadmin httpd logs:
Wed Nov 29 05:33:35.591298 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] mod_wsgi (pid=19004): Target WSGI script ‘/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi’ cannot be loaded as Python module.
[Wed Nov 29 05:33:35.591382 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] mod_wsgi (pid=19004): Exception occurred processing WSGI script ‘/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi’.
[Wed Nov 29 05:33:35.591523 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] Traceback (most recent call last):
[Wed Nov 29 05:33:35.591575 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi”, line 25, in
[Wed Nov 29 05:33:35.591585 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] import config
[Wed Nov 29 05:33:35.591594 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] File “/usr/lib/python2.7/site-packages/pgadmin4-web/config.py”, line 30, in
[Wed Nov 29 05:33:35.591600 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
[Wed Nov 29 05:33:35.591607 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/__init__.py”, line 17, in
[Wed Nov 29 05:33:35.591626 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] from flask import Flask, abort, request, current_app, session, url_for
[Wed Nov 29 05:33:35.591633 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/__init__.py”, line 21, in
[Wed Nov 29 05:33:35.591636 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] from .app import Flask, Request, Response
[Wed Nov 29 05:33:35.591642 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 27, in
[Wed Nov 29 05:33:35.591645 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] from . import json, cli
[Wed Nov 29 05:33:35.591651 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/cli.py”, line 17, in
[Wed Nov 29 05:33:35.591654 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] import click
[Wed Nov 29 05:33:35.591673 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12457] ModuleNotFoundError: No module named ‘click’
[Wed Nov 29 05:33:36.262872 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] mod_wsgi (pid=19004): Target WSGI script ‘/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi’ cannot be loaded as Python module.
[Wed Nov 29 05:33:36.262978 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] mod_wsgi (pid=19004): Exception occurred processing WSGI script ‘/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi’.
[Wed Nov 29 05:33:36.263216 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] Traceback (most recent call last):
[Wed Nov 29 05:33:36.263298 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi”, line 25, in
[Wed Nov 29 05:33:36.263313 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] import config
[Wed Nov 29 05:33:36.263326 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] File “/usr/lib/python2.7/site-packages/pgadmin4-web/config.py”, line 30, in
[Wed Nov 29 05:33:36.263338 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
[Wed Nov 29 05:33:36.263351 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/__init__.py”, line 17, in
[Wed Nov 29 05:33:36.263362 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] from flask import Flask, abort, request, current_app, session, url_for
[Wed Nov 29 05:33:36.263374 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/__init__.py”, line 21, in
[Wed Nov 29 05:33:36.263384 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] from .app import Flask, Request, Response
[Wed Nov 29 05:33:36.263396 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 27, in
[Wed Nov 29 05:33:36.263406 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] from . import json, cli
[Wed Nov 29 05:33:36.263417 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/cli.py”, line 17, in
[Wed Nov 29 05:33:36.263427 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] import click
[Wed Nov 29 05:33:36.263455 2017] [wsgi:error] [pid 19004] [remote 118.107.138.121:12459] ModuleNotFoundError: No module named ‘click’
Hope your quick response
In Apache mod_wsgi already loaded
[Wed Nov 29 06:02:53.192033 2017] [so:warn] [pid 15413] AH01574: module wsgi_module is already loaded, skipping
Try to check the /etc/httpd/conf.d/pgadmin4.conf maybe you did somthing wrong there .
I want to use pgadmin4 V2 with POSTGRESQL 10.1 as phppgadmin 5.1 doesn’t support POSTGRESQL 10.1
I am using Virtualmin for creating virtual servers. I have created new virtual server, Below is the httpd.conf configuration of virtual host
SuexecUserGroup “#1008” “#1002”
ServerName pgadmin.domain.com
ServerAlias http://www.pgadmin.domain.com
ServerAlias webmail.pgadmin.domain.com
ServerAlias admin.pgadmin.domain.com
DocumentRoot /home/pgadmin/public_html
ErrorLog /var/log/virtualmin/pgadmin.domain.com_error_log
CustomLog /var/log/virtualmin/pgadmin.domain.com_access_log combined
ScriptAlias /cgi-bin/ /home/pgadmin/cgi-bin/
ScriptAlias /awstats/ /home/pgadmin/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
AddHandler fcgid-script .php7.0
FCGIWrapper /home/pgadmin/fcgi-bin/php7.0.fcgi .php
FCGIWrapper /home/pgadmin/fcgi-bin/php5.fcgi .php5
FCGIWrapper /home/pgadmin/fcgi-bin/php7.0.fcgi .php7.0
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.pgadmin.domain.com
RemoveHandler .php
RemoveHandler .php5
RemoveHandler .php7.0
FcgidMaxRequestLen 1073741824
AuthName “pgadmin.domain.com statistics”
AuthType Basic
AuthUserFile /home/pgadmin/.awstats-htpasswd
require valid-user
Alias /dav /home/pgadmin/public_html
DAV on
AuthType Basic
AuthName “pgadmin.domain.com”
AuthUserFile /home/pgadmin/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php5
RemoveHandler .php7.0
RewriteEngine off
WSGIDaemonProcess pgadmin processes=1 threads=25
WSGIScriptAlias / /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
Require all granted
WSGIDaemonProcess pgadmin processes=1 threads=25
WSGIScriptAlias / /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
Require all granted
Man, obviously well not work, create your the pgadmin virtual host without using Virtualmin like indicated in the tutorial and it’will works correctly because you didn’t neither indicated the directory /usr/lib/python2.7/site-packages/pgadmin4-web/ in your virtualHost file you indicated the wrong Document Root “/home/pgadmin/public_html “.
Your File should Be like this
# vi /etc/httpd/conf.d/pgadmin4.conf
ServerName Your_Server_Name Or IP
WSGIDaemonProcess pgadmin processes=1 threads=25
WSGIScriptAlias / /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
Require all granted
Thank you for this article, it was very helpful!
Hi Jiří,
You are welcome anytime. Please subscribe to our YouTube channel to keep updated.
Thanks
I followed all your step-by-step but when I try to access pgadmin on firefox it says “server not found”.
Hi Glailson,
I think you should create an entry DNS for your server or try to access it via IP.
Hi, every step went okey, but the page didn’t load when i tried http://pgadmin.yallalabs.local on my CentOS 7 server browser. What could be the problem?
Hi Peter, you need to modify the server name entry on the virtual host file /etc/httpd/conf.d/pgadmin4.conf from pgadmin.yallalabs.local by the fqdn of your server or you can use the ip and after that restart the Apache
Hello,
Do you know how can I install pgAdmin like normal? Like I can get it through the Applicatons | Programming | PgAdmin on CentOS.
Or does pgAdmin 4 do away with this way of doing things?
Hi Jay,
On centOS or RHEL, you can install pgadmin 4 in server mode as web application web or in Desktop mode. There is no other options.
I did this (using IP address) but when I type the IP address into the browser, I get the default apache page. TESTING 123
In the tutorial we created a new virtual host with the server name pgadmin.yallalabs.com obviously if you want to connect to the pgadmin you need an A record in your DNS server to point to the pgadmin server using the fqdn pgadmin.yourdomain.com . If you want to get access via ip you should not create a new virtual host just modify the default httpd config file httpd.conf.
Well, as I am hosting another web application on the server I am thinking that virtual hosts is the way to go. So what I did just now was to change ServerName to pgadmin.localhost.localdomain and I restarted httpd. But when I use pgadmin.localhost.localdomain the same TESTING 123 web page comes up.
May be I should look into install it in desktop mode (make a video for CentOS!)
Then you can access it as subfolder for example your servername.domain.com/pgadmin
By changing WSGIScriptAlias from “WSGIScriptAlias /” to ” WSGIScriptAlias /pgadmin” always in httpd.conf config file
It was already set to WSGIScriptAlias /pgadmin4
so localhost.localdomain/pgadmin4
THANK YOU!
It works ?
From what I am seeing yes I can connect to my database (using your other tutorial)
Great we are glad that it works
Hi, I have a problem when I execute the setup. I think, the script not found pgadmin.model but I don’t know how repair this. Can you help me ?
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/pgadmin4-web/setup.py”, line 15, in
from pgadmin.model import db, Version, SCHEMA_VERSION as CURRENT_SCHEMA_VERSION
File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/__init__.py”, line 33, in
from pgadmin.utils.session import create_session_interface, pga_unauthorised
File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/utils/session.py”, line 26, in
import config
File “/usr/lib/python2.7/site-packages/pgadmin4-web/config.py”, line 121, in
if builtins.SERVER_MODE is None:
Try to use a root user to perform the execution and set the Selinux to permissive mode and try again .
I resolve my problem, I reinstall postgresql 11 and PGAdmin 4 and it works.
Thank you for your help and your documentation.
how to do authenticat pgadmin4 with ldap (not with email : [email protected] )
Hi siddartha,
Unfortunately it’s not possible to use ldap authentication with pgAdmin, when you install pgAdmin 4 in server mode, you will be prompted for an administrator email and password for the pgAdmin client.
Using the User Management, you can add or delete pgAdmin users and assign roles.
Hi
I installed httpd, postgresql96, pgadmin4, mod_wsgi with yum from the pgdg96 repository.
When i try to access pgadmin4 with http://myservername/pgadmin4 i get a internal server error and the error_log in /var/log/httpd shows the following:
[Tue Nov 20 09:41:28.851147 2018] [:error] [pid 18097] [remote 10.100.17.148:20] mod_wsgi (pid=18097): Exception occurred processing WSGI script ‘/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi’.
[Tue Nov 20 09:41:28.851304 2018] [:error] [pid 18097] [remote 10.100.17.148:20] Traceback (most recent call last):
[Tue Nov 20 09:41:28.851350 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1997, in __call__
[Tue Nov 20 09:41:28.851443 2018] [:error] [pid 18097] [remote 10.100.17.148:20] return self.wsgi_app(environ, start_response)
[Tue Nov 20 09:41:28.851468 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1985, in wsgi_app
[Tue Nov 20 09:41:28.851510 2018] [:error] [pid 18097] [remote 10.100.17.148:20] response = self.handle_exception(e)
[Tue Nov 20 09:41:28.851530 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1540, in handle_exception
[Tue Nov 20 09:41:28.851566 2018] [:error] [pid 18097] [remote 10.100.17.148:20] reraise(exc_type, exc_value, tb)
[Tue Nov 20 09:41:28.851585 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1982, in wsgi_app
[Tue Nov 20 09:41:28.851619 2018] [:error] [pid 18097] [remote 10.100.17.148:20] response = self.full_dispatch_request()
[Tue Nov 20 09:41:28.851638 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1614, in full_dispatch_request
[Tue Nov 20 09:41:28.851699 2018] [:error] [pid 18097] [remote 10.100.17.148:20] rv = self.handle_user_exception(e)
[Tue Nov 20 09:41:28.851728 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1517, in handle_user_exception
[Tue Nov 20 09:41:28.851765 2018] [:error] [pid 18097] [remote 10.100.17.148:20] reraise(exc_type, exc_value, tb)
[Tue Nov 20 09:41:28.851783 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1610, in full_dispatch_request
[Tue Nov 20 09:41:28.851817 2018] [:error] [pid 18097] [remote 10.100.17.148:20] rv = self.preprocess_request()
[Tue Nov 20 09:41:28.851837 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask/app.py”, line 1825, in preprocess_request
[Tue Nov 20 09:41:28.851870 2018] [:error] [pid 18097] [remote 10.100.17.148:20] func(request.endpoint, request.view_args)
[Tue Nov 20 09:41:28.851903 2018] [:error] [pid 18097] [remote 10.100.17.148:20] File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/__init__.py”, line 632, in strip_version_number
[Tue Nov 20 09:41:28.851952 2018] [:error] [pid 18097] [remote 10.100.17.148:20] if (config.APP_VERSION_PARAM in values):
[Tue Nov 20 09:41:28.852003 2018] [:error] [pid 18097] [remote 10.100.17.148:20] TypeError: argument of type ‘NoneType’ is not iterable
content of /etc/httpd/conf.d/pgadmin4.conf :
LoadModule wsgi_module modules/mod_wsgi.so
WSGIDaemonProcess pgadmin processes=1 threads=25
WSGIScriptAlias /pgadmin4 /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi
WSGISocketPrefix run/wsgi
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
# Apache 2.4
Require all granted
# Apache 2.2
Order Deny,Allow
Allow from All
What can be the cause of this?
Hi,
try to disable SELinux
hi, i have followed all your steps and all working well. this is my first time with psql. the problem is, i want to create the server inside the pgadmin4 interface but failed. can u give the example of HOSTNAME, USER AND password. tq
Note: I am testing the installation inside the oracle vm virtualbox
Hi Dean,
To connect a server, you should have a postgresql DB server installed, the steps to connect to a Postgresql is a easy, just follow this tutorial http://yallalabs.com/linux/how-to-connect-to-a-postgresql-database-using-pgadmin4/
getting error when running setup.py
[root@clout netadmin]# python /usr/lib/python2.7/site-packages/pgadmin4-web/setup.py
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/pgadmin4-web/setup.py”, line 15, in
from pgadmin.model import db, Version, SCHEMA_VERSION as CURRENT_SCHEMA_VERSION
File “/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/__init__.py”, line 20, in
from flask_security import Security, SQLAlchemyUserDatastore, current_user
File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask_security/__init__.py”, line 13, in
from .core import Security, RoleMixin, UserMixin, AnonymousUser, current_user
File “/usr/lib/python2.7/site-packages/pgadmin4-web/flask_security/core.py”, line 18, in
from flask_babelex import Domain
ImportError: No module named flask_babelex
I have same problem when I installed pgadmin4-v2 with postgresql-9.6.3 server.
Hello Lofti
I need help please:
With Centos 7, i try to install pgadmin 4 in my postgresql, and i have this problem when i configure vi /usr/lib/python2.7/site-packages/pgadmin4-web/config_distro.py
LOG_FILE = ‘/var/log/pgadmin4/pgadmin4.log’
SQLITE_PATH = ‘/var/lib/pgadmin4/pgadmin4.db’
SESSION_DB_PATH = ‘/var/lib/pgadmin4/sessions’
STORAGE_DIR = ‘/var/lib/pgadmin4/storage’
Here is the problem:
usr/lib/python2.7/site-packages/pgadmin4-web/config_distro.py” E212: Can’t open file for writing
Note: i’m already in root user shown as below:
[root@Host-001 ~]# vi /usr/lib/python2.7/site-packages/pgadmin4-web/config_distro.py
Thanks for your help if you can see my message, or if anyone can help me because I’m a beginner.
John