[python-ldap] Imports from pyasn1 fail?

Jeroen van Meeuwen (Kolab Systems) vanmeeuwen at kolabsys.com
Mon Apr 11 15:16:36 CEST 2011


Hi Michael,

somehow imports from pyasn1 fail all over the place. I'm running 
pyasn1-0.0.13b and pyasn1-modules-0.0.1a, but the following snippet bails out:

# Imports from pyasn1
from pyasn1.type import namedtype,namedval,univ,constraint
from pyasn1.codec.ber import encoder,decoder
from pyasn1_modules.rfc2251 import LDAPDN

Stating:

Traceback (most recent call last):
  File "persistent_search.py", line 7, in <module>
    from ldap.controls import psearch
  File "/usr/lib64/python2.7/site-packages/ldap/controls/psearch.py", line 23, 
in <module>
    from pyasn1.type import namedtype,namedval,univ,constraint
ImportError: No module named type

based on this morning's CVS head. I recon the dual use of 'pyasn1' on both 
ends is creating a namespace conflict.

I worked around another occurence of this problem in ldap.controls.pyasn1 
where the pyasn1.codec.ber could not be found, by making importing pyasn1 and 
making the calls to pyasn1.codec.ber.encoder/decoder.encode/decode fully 
qualified.

Kind regards,

Jeroen van Meeuwen

-- 
Senior Engineer, Kolab Systems AG

e: vanmeeuwen at kolabsys.com
t: +316 42 801 403
w: http://www.kolabsys.com

pgp: 9342 BF08
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20110411/686f177e/attachment.html>


More information about the python-ldap mailing list