B
B
bro772016-05-23 17:54:53
Django
bro77, 2016-05-23 17:54:53

How to solve problem with No module named 'django'?

After installing psycopg2, the following error appeared:

[Mon May 23 10:27:13.172654 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] mod_wsgi (pid=10094): Target WSGI script '/var/www/s052d78fe.fastvps-server.com/public_html/msite/msite/apache/wsgi.py' cannot be loaded as Python module.
[Mon May 23 10:27:13.172758 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] mod_wsgi (pid=10094): Exception occurred processing WSGI script '/var/www/s052d78fe.fastvps-server.com/public_html/msite/msite/apache/wsgi.py'.
[Mon May 23 10:27:13.172811 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] Traceback (most recent call last):
[Mon May 23 10:27:13.173027 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426]   File "/var/www/s052d78fe.fastvps-server.com/public_html/msite/msite/apache/wsgi.py", line 7, in <module>
[Mon May 23 10:27:13.173037 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426]     from django.core.wsgi import get_wsgi_application
[Mon May 23 10:27:13.173063 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] ImportError: No module named 'django'

The Django module is installed, but why is the system not seeing it.
sys.path:
'', '/var/www/s052d78fe.fastvps-server.com/public_html/myv/lib/python3.4',
'/var/www/s052d78fe.fastvps-server.com/public_html/myv/ lib/python3.4/plat-x86_64-linux-gnu', '/var/www/s052d78fe.fastvps-server.com/public_html/myv/lib/python3.4/lib-dynload',
'/usr/lib/ python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/var/www/s052d78fe.fastvps-server.com/public_html/myv/lib/python3.4/site- packages']
wsgi.py
#wsgi.py
import os
import time
import traceback
import signal
import sys
from django.core.wsgi import get_wsgi_application

# Calculate the path based on the location of the WSGI script.
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
sys.path.append(project)


# Add the path to 3rd party django application and to django itself.
sys.path.append('/var/www/s052d78fe.fastvps-server.com/public_html/myv/lib/python3.4/site-packages')
os.environ['DJANGO_SETTINGS_MODULE'] = 'msite.apache.override'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

I would be happy to receive recommendations to eliminate this situation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Pochepko, 2016-05-28
@Chepapka

what version of python is installed by default on the system? Execute in terminal "python"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question