Note that there are some explanatory texts on larger screens.

plurals
  1. POInstalling Django on Shared Server: No module named MySQLdb?
    primarykey
    data
    text
    <p>I'm getting this error</p> <pre><code>Traceback (most recent call last): File "/home/&lt;username&gt;/flup/server/fcgi_base.py", line 558, in run File "/home/&lt;username&gt;/flup/server/fcgi_base.py", line 1116, in handler File "/home/&lt;username&gt;/python/django/django/core/handlers/wsgi.py", line 241, in __call__ response = self.get_response(request) File "/home/&lt;username&gt;/python/django/django/core/handlers/base.py", line 73, in get_response response = middleware_method(request) File "/home/&lt;username&gt;/python/django/django/contrib/sessions/middleware.py", line 10, in process_request engine = import_module(settings.SESSION_ENGINE) File "/home/&lt;username&gt;/python/django/django/utils/importlib.py", line 35, in import_module __import__(name) File "/home/&lt;username&gt;/python/django/django/contrib/sessions/backends/db.py", line 2, in ? from django.contrib.sessions.models import Session File "/home/&lt;username&gt;/python/django/django/contrib/sessions/models.py", line 4, in ? from django.db import models File "/home/&lt;username&gt;/python/django/django/db/__init__.py", line 41, in ? backend = load_backend(settings.DATABASE_ENGINE) File "/home/&lt;username&gt;/python/django/django/db/__init__.py", line 17, in load_backend return import_module('.base', 'django.db.backends.%s' % backend_name) File "/home/&lt;username&gt;/python/django/django/utils/importlib.py", line 35, in import_module __import__(name) File "/home/&lt;username&gt;/python/django/django/db/backends/mysql/base.py", line 13, in ? raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb </code></pre> <p>when I try to run this script on my shared server</p> <pre><code>#!/usr/bin/python import sys, os sys.path.insert(0, "/home/&lt;username&gt;/python/django") sys.path.insert(0, "/home/&lt;username&gt;/python/django/www") # projects directory os.chdir("/home/&lt;username&gt;/python/django/www/&lt;project&gt;") os.environ['DJANGO_SETTINGS_MODULE'] = "&lt;project&gt;.settings" from django.core.servers.fastcgi import runfastcgi runfastcgi(method="threaded", daemonize="false") </code></pre> <p>But, my web host just installed <code>MySQLdb</code> for me a few hours ago. When I run python from the shell I can import <code>MySQLdb</code> just fine. Why would this script report that it can't find it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload