0

I worked for 4 months on an webapp and when I tried to deploy it, I saw this message on the server.

Traceback (most recent call last): File "/srv/data/web/vhosts/default/wsgi.py", line 12, in from FlaskApp import app as application File "./FlaskApp/init.py", line 3, in from flask import Flask, render_template ModuleNotFoundError: No module named 'flask'

There is also this line I don't understand :

!!! no internal routing support, rebuild with pcre support !!!

So, I have the requirements.txt and the wsgi.py, do I have something to activate with a script or other ? Because I have the feeling that the venv is not activate on the server..?

Neuron
  • 5,141
  • 5
  • 38
  • 59
  • try running requirements.txt file manually pip install -r requirements.txt – shahidammer Sep 05 '18 at 10:18
  • You need to specify your python path in apache or nginx configurations. if using venv. https://stackoverflow.com/questions/27450998/run-mod-wsgi-with-virtualenv-or-python-with-version-different-that-system-defaul – Lalitkumar Tarsariya Sep 05 '18 at 10:20

1 Answers1

1

Your error is telling you flask is not installed.

You can see what packages you have installed with:

pip list

Install with your requirements.txt:

pip install -r requirements.txt

Install flask alone:

pip install flask

be sure your wsgi is calling the right python executable if you are using virtualenv you need to set the complete path into your wsgi config.


!!! no internal routing support, rebuild with pcre support !!!

This error is because you need libpcre you can install it like this:

apt-get install libpcre3 libpcre3-dev -y

then reinstall uwsgi

pip uninstall uwsgi

pip install uwsgi --no-cache
bboumend
  • 490
  • 3
  • 13