Import error with python-openid in django

2.1k views Asked by At

I have a problem with using python-openid in my django project. If import anything from openid module I receive an exception in a runtime.

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 1.4
Python Version: 2.7.1
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
  101.                             request.path_info)
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in resolve
  298.             for pattern in self.url_patterns:
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in url_patterns
  328.         patterns = getattr(self.urlconf_module, "urlpatterns",               self.urlconf_module)
  File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in urlconf_module
    323.             self._urlconf_module = import_module(self.urlconf_name)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py" in import_module
    35.     __import__(name)
  File "/Users/air/Desktop/givemecoin/givemecoin/urls.py" in <module>
    2. from givemecoin.views import hello, register, new_user_welcome, profile, payment
  File "/Users/air/Desktop/givemecoin/givemecoin/views.py" in <module>
    17. from openid.store.filestore import FileOpenIDStore

  Exception Type: ImportError at /
  Exception Value: No module named consumer.consumer

But python-openid is correctly installed in '/Library/Python/2.7/site-packages' and this dir in python path. And I can import openid module from command-line python.

Python 2.7.1, Mac OS X 10.7, python-openid 2.2.5.

1

There are 1 answers

0
Leonid Dubov On

I had have openid.pyc in project folder. My fault. Big thanks for @waitinforatrain for help.