uwsgi plugin "python3" works with Python 3.6 and not with Python3.8

Viewed 1340

I have the following uwsgi config:

[uwsgi]
callable=app
mount = /labs=/home/vinzee/projectname/app/wsgi.py
manage-script-name = true
touch-reload=/home/vinzee/projectname/app/wsgi.py
socket=/tmp/labshome.sock
processes=5
threads=1
venv=/home/vinzee/.virtualenvs/projectnamevenv38
chdir=/home/vinzee/projectname/app/
plugin=logfile,python3
logger=delete file:/dev/null/c.log
log-route = delete (\] POST \/save => generated )
pythonpath=/home/vinzee/projectname/

The virtual environment specified in venv uses Python3.8. And when reloading uwsgi, I get the classic error:

ModuleNotFoundError: No module named 'flask'

The same error happens when uwsgi's plugin is python and the project uses Python >= 3, as can be seen in this answer.

When I switch to Python3.6, the ModuleNotFoundError disappears and everything works properly. I already have the package uwsgi-plugin-python3 to the latest version.

How can I get rid of this error for Python3.8? What package do I need to install?

1 Answers

It seems that this is a problem of creating a virtual environment.

virtualenv flask

cd flask

source bin/activate    (for activate env )

also you can try to add your python path in wsgi file config

sys.path.append('/home/deployer/anaconda3/lib/python3.5/site-packages')

or

export PYTHONPATH=/root/environments/my_env/lib/python3.6/site-packages/

finally.. run :

python -m flask run
Related