[python-ldap] problems using import ldap

Michael Ströder michael at stroeder.com
Thu Jul 28 10:39:44 CEST 2011

Francis Abrante wrote:
> I still have problems, but I think that my problem come from the library
> version. I don't know from where I can get the egg version for python 2.7.
> From    http://svn.kmrc.de/download/distribution/contrib/  only allow me until
> 2.6 
> /usr/local/bin/python2.7
> /home/orbac/TSP-CloudStack/src/it/tsp/cloudstack/orbac/LDAP Agent/get_info.py
> Traceback (most recent call last):
>   File "/home/orbac/TSP-CloudStack/src/it/tsp/cloudstack/orbac/LDAP
> Agent/get_info.py", line 1, in <module>
>     import ldap
>   File
> "/usr/local/lib/python2.7/site-packages/python_ldap-2.3.9-py2.6-linux-x86_64.egg/ldap/__init__.py",
> line 22, in <module>
>     from _ldap import *
> ImportError:
> /usr/local/lib/python2.7/site-packages/python_ldap-2.3.9-py2.6-linux-x86_64.egg/_ldap.so:
> wrong ELF class: ELFCLASS64

This rather sounds to me that you've compiled python-ldap for 64-bit platform
but the Python interpreter you're using is a 32-bit build.

It seems that to that you should really clean up your system. You're mixing
build platforms, Python versions, python-ldap etc. That's a big mess.

Especially you should read and understand about how DistUtils are working (the
link I've posted before).

Ciao, Michael.

More information about the python-ldap mailing list