84067

Django mod-python error

Can someone please tell what this strange error is

Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch log=debug) File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 464, in import_module module = imp.load_module(mname, f, p, d) File "/project/django/django/core/handlers/modpython.py", line 4, in ? from django import http File "/project/django/django/http/__init__.py", line 3, in ? from Cookie import SimpleCookie, CookieError ImportError: No module named Cookie Edit: Python Python 2.4.3 (#1, Jan 14 2008, 18:32:40) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Cookie import SimpleCookie, CookieError >>> from http.Cookie import SimpleCookie, CookieError Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named http.Cookie >>> import Cookie >>> import http.Cookie Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named http.Cookie >>> import http.Cookie

Answer1:

That you're missing the Cookie package (which is not part of Django), but it should be Builtin.

If you're using Python 3 please note that Cookie has been renamed to http.cookies, and that Django is incompatible with Python not 2.x.

That is what you're missing: http://docs.python.org/library/cookie.html.

Edit

I see you're running python 2.4. Consider switch to python 2.6 or 2.7, and check the presence of /usr/lib/python2.4/Cookie.py

Solution

The path was missing, so adding

sys.path.append('/usr/lib/python2.4/')

solves the issue.

Recommend

  • Stop-AzureVM does not shutdown my Azure-VM (Runbook)
  • Custom “cellfilter” in Angular js
  • Converting VBScript's Imp Operator
  • ActiveMQ JMS XA Atomikos - Transaction not started error
  • How to solve singular matrices?
  • How to compile python code that uses boto to access S3?
  • What are all the ways to import modules in Python?
  • AttributeError: module 'django.contrib.auth.views' has no attribute 'login'
  • Python's imp.reload() function is not working?
  • Removing Small Regions from a Binary Image
  • ProgrammingError: relation 'blah blah' does not exist, trying to run the specific migratio
  • ImageJ jar file plugin shortcut creation - More help needed
  • PYTHON: nosetests import file path with multiple modules/files
  • Python: Sort nested dictionary by value
  • PHP says “No Database selected” even after using mysqli_select_db()
  • Getting error : No value given for one or more required parameters
  • Upgrading to Django 1.7: Getting AppRegistryNotReady for translation infrastructure
  • VBA Filter Table and Copy Subset of Resulting Columns to Clipboard
  • oracle duplicate rows based on a single column
  • Why cannot top level module be set to main in Hint
  • SWIG ImportError: undefined symbol: _Py_RefTotal
  • Does anyone have a Categorized XML Corpus Reader for NLTK?
  • Does Apportable support to build library binary (.a/.so)?
  • Jenkins: FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
  • Is there a perl module to validate passwords stored in “{crypt}hashedpassword” “{ssha}hashedpassword
  • Switching to Release Build causes runtime error in Web Reference
  • Meteor helpers not available in Angular template
  • Getting last autonumber in access
  • Why winpcap requires both .lib and .dll to run?
  • QuartzCore.framework for Mono Develop
  • Return words with double consecutive letters
  • bootstrap to use multiple ng-app
  • How to get icons for entities from eclipse?
  • Python: how to group similar lists together in a list of lists?
  • using HTMLImports.whenReady not working in chrome
  • -fvisibility=hidden not passed by compiler for Debug builds
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Turn off referential integrity in Derby? is it possible?
  • JaxB to read class hierarchy
  • Busy indicator not showing up in wpf window [duplicate]