pgadmin4 - New install not working
Solution 1
This error message shows that your environment is missing a package called flask_babel
. To install it, switch to the virtualenv your webserver uses and install it with this command:
pip install flask_babel
If you are not using any virtual environment for your python scripts, you have to prepend sudo
to the command. But you should really consider using a virtualenv for your projects.
Solution 2
If you are using virtualenv to run pgAdmin4 then you need to activate it first, Refer Apache mine wsgi file.
Solution 3
Flask_babel is one of the dependencies of pgAdmin4, and there will be others.
You may find it easier to use a Python Wheel installer, which you can find here: https://www.pgadmin.org/download/pgadmin-4-python-wheel/
With this distribution, simply execute:
pip install ./pgadmin4-2.1-py2.py3-none-any.whl
And then configure the application as indicated on the website.
If you run this command in a virtual environment, the dependencies will be installed in this environment.
If you want to run on an Apache server, this installation will produce a .wsgi file in the site-packages folder of your python installation.
Admin
Updated on June 08, 2022Comments
-
Admin almost 2 years
I downloaded the
postgresql-9.6.0-1-linux-x64.run
package and ran through the installer on ubuntu 16.04. Postgres is working fine. I am trying to use the pgadmin4 package that was included with this installer. I created a site in Apache per the instructions.This is the error I am getting in the server.log file in Apache. Not sure how to fix this.
Traceback (most recent call last): File "/opt/PostgreSQL/9.6/pgAdmin4/web/pgAdmin4.wsgi", line 8, in <module> from pgAdmin4 import app as application File "/opt/PostgreSQL/9.6/pgAdmin4/web/pgAdmin4.py", line 24, in <module> from pgadmin import create_app File "/opt/PostgreSQL/9.6/pgAdmin4/web/pgadmin/__init__.py", line 18, in <module> from flask_babel import Babel, gettext ImportError: No module named flask_babel