I have a Flask app that I want to run in uwsgi, with nginx proxy. I mostly followed the advice in these two articles: uwsgi upstart on amazon linux and https://iotbytes.wordpress.com/python-flask-web-application-on-raspberry-pi-with-nginx-and-uwsgi/. But I was never able to use either venv or virtualenv parameter in uwsgi.ini file - it appeared to be ignored. My Flask app needed to import matplotlib which was only installed in my virtualenv and attempting to run the app gave 500 error, since it could not find matplotlib.
I finally got uwsgi working with the following config:
[uwsgi]
plugins = python
#virtualenv = /home/pi/wx/.venv
#pythonpath = /home/pi/wx/.venv
pythonpath = /home/pi/wx/.venv/lib/python3.9/site-packages
chdir = /home/pi/wx/app
callable = app
wsgi-file = /home/pi/wx/app/app0.py
I have commented out my failures with virtualenv and pythonpath. When I specified the full path to site-packages, my Flask app finally ran under WSGI. I never read any article that stated that path as the correct specification.
Can someone tell me why virtualenv parameter didn't work? Also what is the "correct" value for pythonpath?