Skip to content
Advertisement

Flask – WSGI – No module named ‘flask’

I’ve been following Sentdex’ Flask tutorial. He’s using a Venv to set up his Flask, but didn’t set his Python up to work with a Venv. I’ve tried installing Flask globally – yet it still doesn’t work. Trying to browse to the server returns a 500 Internal Server Error

I’m getting the usual no module named flaskerror.

errorFGL.log

JavaScript

__init__.py

JavaScript

flaskapp.wsgi

JavaScript

fgl-database.conf

JavaScript

Advertisement

Answer

As is polite behaviour when finding the solution, I googled around a bit more, and somehow managed to find a solution from a YouTube commment by Nathan Nichols here:

https://www.digitalocean.com/community/tutorials/how-to-run-django-with-mod_wsgi-and-apache-with-a-virtualenv-python-environment-on-a-debian-vps

  1. Edit /etc/apache2/sites-available/FlaskApp.conf
  2. Add the following two lines before the “WSGIScriptAlias” line:

    JavaScript
  3. Restart Apache with “service apache2 restart”

I of course replaced the Python version with python3.5, which is what I’m running.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement