Question: Error trying to run pgAdmin4


Error trying to run pgAdmin4

Answers 1
Added at 2016-12-21 11:12

I've installed postgresql 9.6 (using suggested linux installer) which comes with pgAdmin4, but getting a few errors.

First, I had to change the folder name from "pgAdmin 4" (note the extra space) to "pgAdmin4" to avoid "file not found error".

Then I run sudo python and got the following error:

Traceback (most recent call last):
   File "../../", line 24, in <module>
      from pgadmin import create_app
   File "/opt/PostgreSQL/9.6/pgAdmin4/web/pgadmin/", line 17, in <module>
      from flask import Flask, abort, request, current_app
ImportError: No module named flask

I tried following this related question: Flask ImportError: No Module Named Flask -- managed to installed flask on virtualenv.

But then I started getting other flask related modules that are missing: flask_babel, flask_login, flask_security. I installed all of them using pip, but then I got an error on missing module htmlmin.minify which I can't seems to able to install.

Traceback (most recent call last):
   File "../", line 24, in <module>
      from pgadmin import create_app
   File "/opt/PostgreSQL/9.6/pgAdmin4/web/pgadmin/", line 23, in <module>
      from htmlmin.minify import html_minify
ImportError: No module named htmlmin.minify

I also exported PYTHONPATH to the one on flask, as described here, still getting the same error.

So, anyone have an idea how to make pgAdmin4 work on ubuntu environemt?

nr: #1 dodano: 2016-12-21 11:12

According to

You download the pgadmin4-1.1-py2-none-any.whl or pgadmin4-1.1-py3-none-any.whl depending on the python version you use.

Then install the virtualenv by running:

sudo apt-get install virtualenv

You also need to install these 2 libraries:

sudo apt-get install libpq-dev python-dev 


mkdir pgadmin4
cd pgadmin4

Run the virtualenv inside of pgadmin4:

virtualenv venv

Activate the virtualenv:

. venv/bin/activate

After that you will see (venv) in the terminal.

Inside of pgadmin4 run:

pip install ./pgadmin4-1.1-py2-none-any.whl

After that you must be able to run pgadmin4 (according to the official website. I haven't tested it personally):

python ~/pgadmin4/lib/python2.7/site-packages/pgadmin4/ (probably this path needs to be corrected)

Open your browser and point to:

Hope this helps.

Source Show
◀ Wstecz