D
D
Dmitry Filyushin2016-10-12 16:16:27
Flask
Dmitry Filyushin, 2016-10-12 16:16:27

How is pip install flask different from apt-get install python-flask?

Installed Flask via pip. Works from com. line, but not called via mod_wsgi. I tried all the examples, all the instructions.
It crashes like this:

[Wed Oct 12 19:08:07.132504 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175] mod_wsgi (pid=10975): Target WSGI script '/var/www/librusec/librusec.wsgi' cannot be loaded as Python module.
[Wed Oct 12 19:08:07.132610 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175] mod_wsgi (pid=10975): Exception occurred processing WSGI script '/var/www/librusec/librusec.wsgi'.
[Wed Oct 12 19:08:07.132641 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175] Traceback (most recent call last):
[Wed Oct 12 19:08:07.132669 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175]   File "/var/www/librusec/librusec.wsgi", line 5, in <module>
[Wed Oct 12 19:08:07.132712 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175]     from librusec import app as application
[Wed Oct 12 19:08:07.132726 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175]   File "/var/www/librusec/librusec.py", line 1, in <module>
[Wed Oct 12 19:08:07.132747 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175]     from flask import Flask
[Wed Oct 12 19:08:07.132772 2016] [wsgi:error] [pid 10975] [remote 127.0.0.1:1175] ImportError: No module named flask

After installing apt-get install python-flask on Ubuntu, everything worked! What is the reason?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil Biryukov-Romanov, 2016-10-12
@Filyushin

Because apt-get is the system package manager.
And pip is a package manager for python.
Most likely you installed flask in virtualenv and that's why it didn't work via mod_wsgi.
To run flask look at the web server in python - gunicorn

S
sim3x, 2016-10-12
@sim3x

https://www.digitalocean.com/community/tutorials/h...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question