failed to install python_Python module failed to import

I am pretty sure that I am missing something naive. I tried to look up for the solution online but seems like I couldn't find it either.

I am trying to install pgadmin4 on Ubuntu 16.04 LTS. I have installed miniconda2 following instructions here. Then I tried to install pgadmin4 following instructions here.

First I was getting an error:

ImportError: No module named flask

when I tried to run

sudo python ~/miniconda2/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

But I was successfully able to python -c "import flask" from terminal.

Then I resolved it by installing

sudo apt-get install python-flask

But now if I try to run pgAdmin4.py it gives me following error:

ImportError: No module named flask_babel

and again I am successfully able to import it if I run following command.

python -c "import flask_babel"

I am not sure what I am missing, any help would be really appreciated.

Edit

Okay, so I removed that error by installing

sudo apt-get install python-flask-babel (Thanks to Peter Wood's comment)

Now I am getting another error:

ImportError: No module named flask_htmlmin

And I guess I can resolve this too in the same pattern, but my confusion is why those imports works when I do from terminal (inline python or even if I just run python from terminal and import it by myself) and why it doesn't work when I run the script (i.e. pgAdmin4.py in this case).

解决方案

暂无回答

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值