Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run pgadmin4, no module named flask error

I have search similar error in StackOverflow, but its different than mine. I tried to install pgadmin4 on ubuntu with virtualenv, everything went fine until I tried to run it with following command :

cd pgadmin4
source bin/activate
sudo python ~/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

It raises an error saying :

ImportError: No module named flask

I have flash installed. Running pip show flask under the virtualenv will show :

Name: Flask
Version: 0.11.1
Summary: A microframework based on Werkzeug, Jinja2 and good intentions
Home-page: http://github.com/pallets/flask/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD
Location: /home/myname/pgadmin4/lib/python2.7/site-packages
Requires: itsdangerous, click, Werkzeug, Jinja2

Any idea what is wrong?

Thank you,

like image 989
hudarsono Avatar asked Jun 18 '26 02:06

hudarsono


1 Answers

Provide proper permission to directory by following command,

sudo mkdir "/var/log/pgadmin" 
sudo chmod a+wrx "/var/log/pgadmin" 

sudo mkdir "/var/lib/pgadmin" 
sudo chmod a+wrx "/var/lib/pgadmin"

And then run the pgAdmin4 without sudo

cd pgadmin4
source bin/activate
python ~/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
like image 154
Murtuza Z Avatar answered Jun 21 '26 10:06

Murtuza Z