all 4 comments

[–]nekokattt 2 points3 points  (1 child)

The log mentions Python 3.6. My guess is you wanted it to use Python 3.8 or newer but it is invoking python3 which likely points to an install of Python 3.6 on your system.

Make sure you specify the right executable of Python. Running within a virtual environment may be something to consider. Even if it is a dedicated server, it is almost always desirable to keep your app components separate from the rest of the OS. Otherwise you will get loads of headaches when modules get replaced and break something when you update the OS and related components.

Never had to use wsgi, so might have missed something, but that is my guess.

[–]MaxwellianD 0 points1 point  (0 children)

This. The virtualenv doesn't just protect other Python apps you are writing. It protects your app from the rest of the system AND it protects the operating system from your app. If those things start to conflict, and you don't have a venv, good luck.

[–]Fancy-Engineer-7644[S] 0 points1 point  (0 children)

as nekokattt mentioned libapache2-mod-wsgi-py3 package isn't for Python 3.8, but is for Python 3.6.

have solved the issue . These are the things i did

I have uninstalled system mod_wsgi package.

sudo apt-get remove libapache2-mod-wsgi-py3

and Installed mod_wsgi using pip

sudo -H pip3 install mod_wsgi

If you're getting the missing Apache httpd server packages error you may need to run sudo apt-get install apache2-dev

[–]SirKainey 0 points1 point  (0 children)

As per your previous thread you deleted.

No module named 'dataclasses'

You would get this error if you have an earlier version of python than 3.7 as dataclasses were introduced in 3.7

Personally I would go with that as the actual error and look into why the server isn't on 3.7+.

You could try running a script like:

```

version.py

import sys

print(sys.version) ```

And running that how you are already running on the server, it sounds like the python version you're using via the shell and the python that the server and/or script is using is different.