ImportError: No module named _socket? WSGI Deployment into Apache
Posted
by
Sxkaur
on Server Fault
See other posts from Server Fault
or by Sxkaur
Published on 2012-11-19T17:54:23Z
Indexed on
2012/11/30
23:07 UTC
Read the original article
Hit count: 414
I am using WSGI 3.3 for python 2.7.3 (32bit) for Apache 2.2. I got the binary WSGI from http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so. I have been trying to deploy an application but keep on receiving the ImportError: no module named _socket. I have included my wsgi and error logs.
APACHE config:
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule wsgi_module modules/mod_wsgi.so
<Directory C:/Users/xxxxd/Documents/cahd>
AllowOverride None
Options None
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / C:/Users/xxxxd/Documents/cahd/cahd/django.wsgi import os, sys
sys.path.append('C:/Users/xxxxd/Documents)
sys.path.append('C:/Users/xxxxd/Documents/cahd/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'cahd.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
The error was:
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] Traceback (most recent call last):
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1 ]File "C:/Users/xxxxd/Documents/cahd/django.wsgi", line 10, in <module>
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import django.core.handlers.wsgi
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\django\\Django-1.4.1\\django\\core\\handlers\\wsgi.py", line 8, in <module>
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] from django import http
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\django\\Django-1.4.1\\django\\http\\__init__.py", line 11, in <module>
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] from urllib import urlencode, quote
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\Python27\\Lib\\urllib.py", line 26, in <module>
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import socket
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\Python27\\Lib\\socket.py", line 47, in <module>
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import _socket
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] ImportError: No module named _socket
© Server Fault or respective owner