Reputation: 31
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
Upvotes: 3
Views: 11547
Reputation: 1
fixed near issues with:
pip install flask_babel
pip3 install flask_babelex
mine were:
> Traceback (most recent call last):
File "my_env/lib/python3.8/site-packages/pgadmin4/setup.py", line 31, in
<module>
from pgadmin import create_app
File "/media/netunit/storageII/my_env/lib/python3.8/site-
packages/pgadmin4/pgadmin/__init__.py", line 23, in <module>
from flask_babelex import Babel, gettext
ModuleNotFoundError: No module named 'flask_babelex'
Upvotes: 0
Reputation: 390
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.
Upvotes: 1
Reputation: 6007
If you are using virtualenv to run pgAdmin4 then you need to activate it first, Refer Apache mine wsgi file.
Upvotes: 3
Reputation: 6477
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.
Upvotes: 3