Flask UWSGI ModuleNotFound

390 Views Asked by At

I have a Flask application that I'm trying to configure for a production environment. So far, during testing python app.py inside of a virtualenv works fine.

However, I'm beginning to configure the application to begin using UWSGI. When I attempt to start the Flask app using

$ uwsgi -s /tmp/myapplication.sock --manage-script-name --mount /myapplication=app:app --virtualenv /path/to/my/venv

I get a

ModuleNotFoundError: No module named 'flask_httpauth'

I was wondering if anyone has experience w/ that authentication module and if they have any advice on what I should do. I'm unsure of why the development server starts without an issue, but the uwsgi server (that I pass the same virtualenv that's used for the dev server) runs into import issues

1

There are 1 best solutions below

0
FloatingRock On

I was able to resolve this issue by setting the home path to my virtualenv directory (.venv in my case):

# uwsgi.ini
home = /Users/floatingrock/Desktop/projects/google_v2/.venv/

If you're wondering, I got the full path using pwd.