0

Django 1.11.7 I installed the python3.6 in the virtual environment. why is it Python/3.5.2 here? and

I cannot visit the web 127.0.0.1 (500 internal server error)

[wsgi:error] [pid 61905:tid 140688926893824] [remote 127.0.0.1:33456] mod_wsgi (pid=61905): Target WSGI script '/home/ubuntu/.../wsgi.py' cannot be loaded as Python module. [wsgi:error] [pid 61905:tid 140688926893824] [remote 127.0.0.1:33456] mod_wsgi (pid=61905): Exception occurred processing WSGI script '/home/ubuntu/.../wsgi.py'. [wsgi:error] [pid 61905:tid 140688926893824] [remote 127.0.0.1:33456] Traceback (most recent call last): [wsgi:error] [pid 61905:tid 140688926893824] [remote 127.0.0.1:33456] File "/home/ubuntu/.../wsgi.py", line 32, in [wsgi:error] [pid 61905:tid 140688926893824] [remote 127.0.0.1:33456] from django.core.wsgi import get_wsgi_application

[wsgi:error] [pid 61905:tid 140688926893824] [remote 127.0.0.1:33456] ImportError: No module named 'django'

how to solve above problem?

Help! thks!!!

yao
  • 13
  • 2

1 Answers1

0

Read:

As is documented, you cannot point mod_wsgi compiled for one Python version at a Python virtual environment created from a different Python version.

Your mod_wsgi has to be compiled for the Python version you want to use.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • I encountered same error as above and my virtual env version is 3.6. I compiled mod_wsgi earlier with python 3.5. How can we point mod_wsgi to newer version? – Eranki Feb 27 '21 at 13:00
  • It works finally after updating mod_wsgu version in apache configuration. For those who are getting this error can look into this: https://stackoverflow.com/a/44915354/12113049 – Eranki Feb 27 '21 at 18:34