tags:

views:

20

answers:

1

Hi, I got ImportError while I try to import mercurial module into django app.

This is part of Django debug page:

ImportError at /

No module named mercurial

Python Path: ['/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/pymodules/python2.5']

I tried import mercurial on console:

jail@kotel:~$ python
Python 2.5.5 (r255:77872, Feb  2 2010, 00:25:36) 
>>> import mercurial
>>> print mercurial.__file__
/usr/lib/pymodules/python2.5/mercurial/__init__.pyc

...and tried re-add this path to sys.path in wsgi file (even if it is already there)

import os, sys
sys.path.append(os.path.join('/', 'usr', 'lib', 'pymodules', 'python2.5'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.beta'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

But still doesn't work

A: 

Tried sys.path.append(os.path.join('/', 'usr', 'lib', 'pymodules', 'python2.5', 'mercurial')) ?

stevejalim