[Tutor] module not found problem

Kent Johnson kent37 at tds.net
Tue Sep 22 20:21:39 CEST 2009


On Tue, Sep 22, 2009 at 1:56 PM, Parag Shah <adaptives at gmail.com> wrote:
> Hi,
>
> I am using django-openid-consumer, which has a line in it's views.py
> which results in an error due to module not found -
>
> from openid.extensions.pape import Request as PapeRequest
>
> where 'openid.extensions' comes from python-openid-2.2.4 (installed
> using 'python setup.py install'), which has an 'extensions' directory,
> but no 'pape' directory. However, 'extensions' has an __init__.py
> which seems to be importing 'pape', like this:
>
> __all__ = ['ax', 'pape', 'sreg']
> from openid.extensions.draft import pape5 as pape
>
>
> However, the Django app still gives me an error when the line which
> required pape is executed. I started the Python prompt and tried the
> following:
>
>>>> from openid.extensions import pape
>>>> from openid.extensions.pape import PageRequest
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> ImportError: No module named pape

The __init__.py creates the name openid.extensions.pape by importing
from the draft. So there is no openid.extensions.pape module in the
import path. I would try
from openid.extensions import pape
PageRequest = pape.PageRequest

Kent


More information about the Tutor mailing list