Hi Team,
we been trying to install python-ldap — 3.3.1 via PIP3
pip3 install python-ldap
also tried with pip install python-ldap
facing below issue
[root@XXX]$ pip3 install python-ldap
Collecting python-ldap
Using cached python-ldap-3.3.1.tar.gz (379 kB)
Requirement already satisfied: pyasn1>=0.3.7 in /usr/local/lib/python3.6/site-packages (from python-ldap) (0.4.8)
Requirement already satisfied: pyasn1_modules>=0.1.5 in /usr/local/lib/python3.6/site-packages (from python-ldap) (0.2.8)
Using legacy ‘setup.py install’ for python-ldap, since package ‘wheel’ is not installed.
Installing collected packages: python-ldap
Running setup.py install for python-ldap … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c ‘import io, os, sys, se
we understand that https://pypi.org/project/python-ldap/#files no .whl file available and that required for PIP installation.
why that is missed / how can we fix this.
please help us here.
Thanks!
Please copy and paste the entire output of pip install
. The interesting bits and pieces are usually at the end of the output.
Thanks for the quick reply
[root@XXX]$ pip3 install python-ldap
Collecting python-ldap
Using cached python-ldap-3.3.1.tar.gz (379 kB)
Requirement already satisfied: pyasn1>=0.3.7 in /usr/local/lib/python3.6/site-packages (from python-ldap) (0.4.8)
Requirement already satisfied: pyasn1_modules>=0.1.5 in /usr/local/lib/python3.6/site-packages (from python-ldap) (0.2.8)
Using legacy ‘setup.py install’ for python-ldap, since package ‘wheel’ is not installed.
Installing collected packages: python-ldap
Running setup.py install for python-ldap … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-1z304vf7/python-ldap_537e27b2183f43bea575be8c2690c77c/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-1z304vf7/python-ldap_537e27b2183f43bea575be8c2690c77c/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-b3lujmlt/install-record.txt —single-version-externally-managed —compile —install-headers /usr/local/include/python3.6m/python-ldap
cwd: /tmp/pip-install-1z304vf7/python-ldap_537e27b2183f43bea575be8c2690c77c/
Complete output (82 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying Lib/ldapurl.py -> build/lib.linux-x86_64-3.6
copying Lib/ldif.py -> build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/init.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/async.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/compat.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/constants.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/dn.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/filter.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/functions.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/logger.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-3.6/ldap
creating build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/init.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-3.6/ldap/controls
creating build/lib.linux-x86_64-3.6/ldap/extop
copying Lib/ldap/extop/init.py -> build/lib.linux-x86_64-3.6/ldap/extop
copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-3.6/ldap/extop
copying Lib/ldap/extop/passwd.py -> build/lib.linux-x86_64-3.6/ldap/extop
creating build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/init.py -> build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-3.6/ldap/schema
creating build/lib.linux-x86_64-3.6/slapdtest
copying Lib/slapdtest/init.py -> build/lib.linux-x86_64-3.6/slapdtest
copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-3.6/slapdtest
running egg_info
writing Lib/python_ldap.egg-info/PKG-INFO
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
reading manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘Doc/.build’
writing manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
creating build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-3.6/slapdtest/certs
running build_ext
building ‘_ldap’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/Modules
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong —param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.3.1 -DLDAPMODULE_AUTHOR=python-ldap project -DLDAPMODULE_LICENSE=Python style -IModules -I/usr/include/python3.6m -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.6/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:3:0:
Modules/common.h:9:20: fatal error: Python.h: No such file or directory
#include «Python.h»
^
compilation terminated.
error: command ‘gcc’ failed with exit status 1
—————————————-
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-1z304vf7/python-ldap_537e27b2183f43bea575be8c2690c77c/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-1z304vf7/python-ldap_537e27b2183f43bea575be8c2690c77c/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-b3lujmlt/install-record.txt —single-version-externally-managed —compile —install-headers /usr/local/include/python3.6m/python-ldap Check the logs for full command output.
Hi
Thanks for the doc
below components are already installed on my machine
[root@XXX]$ python3 —version
Python 3.6.8
[root@XXX]$
[root@XXX]$ rpm -qa | grep openldap
openldap-clients-2.4.44-13.el7.x86_64
openldap-2.4.44-13.el7.x86_64
does really required python3-devel component
Great after installed all the prerequisites python-ldap installed properly !!!
thanks
I am facing the same issue in Ubuntu 18.4 python3.8.12 but docs aren’t useful can you please suggest any other way out ?
I am facing the same issue in Ubuntu 18.4 python3.8.12 but docs aren’t useful can you please suggest any other way out ?
Could you please create a new ticket with the build logs and system details?
Collecting python-ldap
Using cached python-ldap-3.3.1.tar.gz (379 kB)
Preparing metadata (setup.py) … done
Requirement already satisfied: pyasn1>=0.3.7 in ./.venv/lib/python3.8/site-packages (from python-ldap) (0.4.8)
Requirement already satisfied: pyasn1_modules>=0.1.5 in ./.venv/lib/python3.8/site-packages (from python-ldap) (0.2.8)
Building wheels for collected packages: python-ldap
Building wheel for python-ldap (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /home/lee/Desktop/annotation-tool/.venv/bin/python3.8 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ bdist_wheel -d /tmp/pip-wheel-uwiw4jrm
cwd: /tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/
Complete output (83 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
copying Lib/ldapurl.py -> build/lib.linux-x86_64-3.8
copying Lib/ldif.py -> build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/constants.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/dn.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/init.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/logger.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/compat.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/filter.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/async.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/functions.py -> build/lib.linux-x86_64-3.8/ldap
creating build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/init.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-3.8/ldap/controls
creating build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/passwd.py -> build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/init.py -> build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-3.8/ldap/extop
creating build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/init.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-3.8/ldap/schema
creating build/lib.linux-x86_64-3.8/slapdtest
copying Lib/slapdtest/init.py -> build/lib.linux-x86_64-3.8/slapdtest
copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-3.8/slapdtest
running egg_info
writing Lib/python_ldap.egg-info/PKG-INFO
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
reading manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘Doc/.build’
adding license file ‘LICENCE’
writing manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
creating build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
running build_ext
building ‘_ldap’ extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/Modules
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.3.1 -DLDAPMODULE_AUTHOR=python-ldap project -DLDAPMODULE_LICENSE=Python style -IModules -I/home/lee/Desktop/annotation-tool/.venv/include -I/usr/include/python3.8 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.8/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:3:0:
Modules/common.h:9:10: fatal error: Python.h: No such file or directory
#include «Python.h»
^~~~~~~~~~
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
ERROR: Failed building wheel for python-ldap
Running setup.py clean for python-ldap
Failed to build python-ldap
Installing collected packages: python-ldap
Running setup.py install for python-ldap … error
ERROR: Command errored out with exit status 1:
command: /home/lee/Desktop/annotation-tool/.venv/bin/python3.8 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-5ga25n50/install-record.txt —single-version-externally-managed —compile —install-headers /home/lee/Desktop/annotation-tool/.venv/include/site/python3.8/python-ldap
cwd: /tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/
Complete output (85 lines):
running install
/home/lee/Desktop/annotation-tool/.venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
copying Lib/ldapurl.py -> build/lib.linux-x86_64-3.8
copying Lib/ldif.py -> build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/constants.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/dn.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/init.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/logger.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/compat.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/filter.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/async.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/functions.py -> build/lib.linux-x86_64-3.8/ldap
creating build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/init.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-3.8/ldap/controls
creating build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/passwd.py -> build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/init.py -> build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-3.8/ldap/extop
creating build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/init.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-3.8/ldap/schema
creating build/lib.linux-x86_64-3.8/slapdtest
copying Lib/slapdtest/init.py -> build/lib.linux-x86_64-3.8/slapdtest
copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-3.8/slapdtest
running egg_info
writing Lib/python_ldap.egg-info/PKG-INFO
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
reading manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘Doc/.build’
adding license file ‘LICENCE’
writing manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
creating build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
running build_ext
building ‘_ldap’ extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/Modules
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.3.1 -DLDAPMODULE_AUTHOR=python-ldap project -DLDAPMODULE_LICENSE=Python style -IModules -I/home/lee/Desktop/annotation-tool/.venv/include -I/usr/include/python3.8 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.8/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:3:0:
Modules/common.h:9:10: fatal error: Python.h: No such file or directory
#include «Python.h»
^~~~~~~~~~
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
—————————————-
ERROR: Command errored out with exit status 1: /home/lee/Desktop/annotation-tool/.venv/bin/python3.8 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-5ga25n50/install-record.txt —single-version-externally-managed —compile —install-headers /home/lee/Desktop/annotation-tool/.venv/include/site/python3.8/python-ldap Check the logs for full command output.
Great after installed all the prerequisites python-ldap installed properly !!!
thanks
Did you use windows or other os ??
Collecting python-ldap
Using cached python-ldap-3.3.1.tar.gz (379 kB)
Preparing metadata (setup.py) … done
Requirement already satisfied: pyasn1>=0.3.7 in ./.venv/lib/python3.8/site-packages (from python-ldap) (0.4.8)
Requirement already satisfied: pyasn1_modules>=0.1.5 in ./.venv/lib/python3.8/site-packages (from python-ldap) (0.2.8)
Building wheels for collected packages: python-ldap
Building wheel for python-ldap (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /home/lee/Desktop/annotation-tool/.venv/bin/python3.8 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ bdist_wheel -d /tmp/pip-wheel-uwiw4jrm
cwd: /tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/
Complete output (83 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
copying Lib/ldapurl.py -> build/lib.linux-x86_64-3.8
copying Lib/ldif.py -> build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/constants.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/dn.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/init.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/logger.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/compat.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/filter.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/async.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-3.8/ldap
copying Lib/ldap/functions.py -> build/lib.linux-x86_64-3.8/ldap
creating build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/init.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls
copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-3.8/ldap/controls
creating build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/passwd.py -> build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/init.py -> build/lib.linux-x86_64-3.8/ldap/extop
copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-3.8/ldap/extop
creating build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/init.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-3.8/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-3.8/ldap/schema
creating build/lib.linux-x86_64-3.8/slapdtest
copying Lib/slapdtest/init.py -> build/lib.linux-x86_64-3.8/slapdtest
copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-3.8/slapdtest
running egg_info
writing Lib/python_ldap.egg-info/PKG-INFO
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
reading manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘Doc/.build’
adding license file ‘LICENCE’
writing manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
creating build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-3.8/slapdtest/certs
copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs
running build_ext
building ‘_ldap’ extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/Modules
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.3.1 -DLDAPMODULE_AUTHOR=python-ldap project -DLDAPMODULE_LICENSE=Python style -IModules -I/home/lee/Desktop/annotation-tool/.venv/include -I/usr/include/python3.8 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.8/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:3:0:
Modules/common.h:9:10: fatal error: Python.h: No such file or directory
#include «Python.h»
^~~~~~~~~~
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
ERROR: Failed building wheel for python-ldap Running setup.py clean for python-ldap Failed to build python-ldap Installing collected packages: python-ldap Running setup.py install for python-ldap … error ERROR: Command errored out with exit status 1: command: /home/lee/Desktop/annotation-tool/.venv/bin/python3.8 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-5ga25n50/install-record.txt —single-version-externally-managed —compile —install-headers /home/lee/Desktop/annotation-tool/.venv/include/site/python3.8/python-ldap cwd: /tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/ Complete output (85 lines): running install /home/lee/Desktop/annotation-tool/.venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build/lib.linux-x86_64-3.8 copying Lib/ldapurl.py -> build/lib.linux-x86_64-3.8 copying Lib/ldif.py -> build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/constants.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/dn.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/init.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/logger.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/compat.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/filter.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/async.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-3.8/ldap copying Lib/ldap/functions.py -> build/lib.linux-x86_64-3.8/ldap creating build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/init.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-3.8/ldap/controls copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-3.8/ldap/controls creating build/lib.linux-x86_64-3.8/ldap/extop copying Lib/ldap/extop/passwd.py -> build/lib.linux-x86_64-3.8/ldap/extop copying Lib/ldap/extop/init.py -> build/lib.linux-x86_64-3.8/ldap/extop copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-3.8/ldap/extop creating build/lib.linux-x86_64-3.8/ldap/schema copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-3.8/ldap/schema copying Lib/ldap/schema/init.py -> build/lib.linux-x86_64-3.8/ldap/schema copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-3.8/ldap/schema copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-3.8/ldap/schema creating build/lib.linux-x86_64-3.8/slapdtest copying Lib/slapdtest/init.py -> build/lib.linux-x86_64-3.8/slapdtest copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-3.8/slapdtest running egg_info writing Lib/python_ldap.egg-info/PKG-INFO writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt writing requirements to Lib/python_ldap.egg-info/requires.txt writing top-level names to Lib/python_ldap.egg-info/top_level.txt reading manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’ reading manifest template ‘MANIFEST.in’ no previously-included directories found matching ‘Doc/.build’ adding license file ‘LICENCE’ writing manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’ creating build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-3.8/slapdtest/certs copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-3.8/slapdtest/certs running build_ext building ‘_ldap’ extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/Modules x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.3.1 -DLDAPMODULE_AUTHOR=python-ldap project -DLDAPMODULE_LICENSE=Python style -IModules -I/home/lee/Desktop/annotation-tool/.venv/include -I/usr/include/python3.8 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.8/Modules/LDAPObject.o In file included from Modules/LDAPObject.c:3:0: Modules/common.h:9:10: fatal error: Python.h: No such file or directory #include «Python.h» ^~~~~~~~~~ compilation terminated. error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1 —————————————- ERROR: Command errored out with exit status 1: /home/lee/Desktop/annotation-tool/.venv/bin/python3.8 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-4yo5vsck/python-ldap_20f7ac56e284475b90fa2b70b3984878/setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /tmp/pip-record-5ga25n50/install-record.txt —single-version-externally-managed —compile —install-headers /home/lee/Desktop/annotation-tool/.venv/include/site/python3.8/python-ldap Check the logs for full command output.
Hi jatin , I am also facing the same issue right now . Could you tell me if you got to solve that issue ?
@Saivikaskillamsetty you need to install all dependencies (including a python development environment — something like python3-dev, depends on your distro)
wich dependecies? only python3-dev?
i’m trying to run my django project but i got this issue:
`pip install django-auth-ldap
Collecting django-auth-ldap
Using cached django_auth_ldap-4.0.0-py3-none-any.whl (20 kB)
Collecting python-ldap>=3.1
Using cached python-ldap-3.4.0.tar.gz (376 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Requirement already satisfied: Django>=2.2 in ./.virtualenvs/intranet/lib/python3.9/site-packages (from django-auth-ldap) (4.0.3)
Requirement already satisfied: sqlparse>=0.2.2 in ./.virtualenvs/intranet/lib/python3.9/site-packages (from Django>=2.2->django-auth-ldap) (0.4.2)
Requirement already satisfied: asgiref<4,>=3.4.1 in ./.virtualenvs/intranet/lib/python3.9/site-packages (from Django>=2.2->django-auth-ldap) (3.5.0)
Collecting pyasn1-modules>=0.1.5
Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting pyasn1>=0.3.7
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Building wheels for collected packages: python-ldap
Building wheel for python-ldap (pyproject.toml) … error
error: subprocess-exited-with-error
× Building wheel for python-ldap (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [83 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
copying Lib/ldapurl.py -> build/lib.linux-x86_64-3.9
copying Lib/ldif.py -> build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/compat.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/init.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/constants.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/functions.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/filter.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/dn.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/logger.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/async.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-3.9/ldap
copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-3.9/ldap
creating build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/init.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-3.9/ldap/controls
copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-3.9/ldap/controls
creating build/lib.linux-x86_64-3.9/ldap/extop
copying Lib/ldap/extop/init.py -> build/lib.linux-x86_64-3.9/ldap/extop
copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-3.9/ldap/extop
copying Lib/ldap/extop/passwd.py -> build/lib.linux-x86_64-3.9/ldap/extop
creating build/lib.linux-x86_64-3.9/ldap/schema
copying Lib/ldap/schema/init.py -> build/lib.linux-x86_64-3.9/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-3.9/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-3.9/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-3.9/ldap/schema
creating build/lib.linux-x86_64-3.9/slapdtest
copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-3.9/slapdtest
copying Lib/slapdtest/init.py -> build/lib.linux-x86_64-3.9/slapdtest
running egg_info
writing Lib/python_ldap.egg-info/PKG-INFO
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
reading manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘Doc/.build’
adding license file ‘LICENCE’
writing manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
creating build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-3.9/slapdtest/certs
copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-3.9/slapdtest/certs
running build_ext
building ‘_ldap’ extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/Modules
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.4.0 «-DLDAPMODULE_AUTHOR=python-ldap project» «-DLDAPMODULE_LICENSE=Python style» -IModules -I/home/lucas/.virtualenvs/intranet/include -I/usr/local/include/python3.9 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.9/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:3:
Modules/common.h:15:10: fatal error: lber.h: Arquivo ou diretório inexistente
15 | #include <lber.h>
| ^~~~~~~~
compilation terminated.
error: command ‘/usr/bin/gcc’ failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-ldap
Failed to build python-ldap
ERROR: Could not build wheels for python-ldap, which is required to install pyproject.toml-based projects
`
In windows i can install the lib if i install the archive .whl, i think in ubuntu it doesnt build the binaries
This steps worked for me on Kali 2022
─# apt-get update -y
└─# apt-get install build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev slapd ldap-utils tox lcov valgrind
└─# apt-get update -y
└─# pip install python-ldap
And whalaaaaa, its working
medeiroslucass, constantino382, adocampo, mr-propre, eMuzhichenko, Yoshyhyrro, shatal0v, TAI-REx, zhanglianxin, trinanda, and 4 more reacted with heart emoji
trinanda and byinarie reacted with rocket emoji
Содержание
- Pip install python ldap error
- ERROR: Could not build wheels for python-ldap in Python #
- Create a virtual environment #
- Try running pip install in verbose mode #
- Conclusion #
- Unable to install on Windows 10: fatal error C1083: Cannot open include file: ‘lber.h’ #243
- Comments
- Unable to install on Windows 10, I tried
- Cant pip python-ldap on 3.6 #297
- Comments
- Use the Python3.6 image
- Set the working directory to /app
- Copy the current directory contents into the container at /app
- Install the dependencies
- run the command to start uWSGI
- Installing python-ldap¶
- Installing from PyPI¶
- Pre-built Binaries¶
- openSUSE Linux¶
- Debian Linux¶
- Windows¶
- FreeBSD¶
- macOS¶
- Installing from Source¶
- Build prerequisites¶
Pip install python ldap error
Reading time В· 4 min
ERROR: Could not build wheels for python-ldap in Python #
To solve the error «Could not build wheels for python-ldap», run the pip install —upgrade pip command to upgrade your pip version and rerun the pip install python-ldap command.
First, make sure to install the prerequisites.
The most common cause of the error is having an outdated version of pip .
Here are the commands for upgrading pip on all operating systems.
Which command works depends on your operating system and your version of Python.
Now that pip is upgraded, try to run the pip install python-ldap command.
If the error is not resolved, upgrade the setuptools and wheel packages as well.
Try to rerun the pip install command after upgrading setuptools and wheel .
If that didn’t help, try to run the pip install command with the —upgrade option.
If the error is not resolved, try installing the package with the —no-cache-dir option to disable the cache.
If that didn’t help, use the —pre option to include pre-release and development versions of the package.
The —pre option makes it so pip includes pre-release and development versions of the package. By default pip only finds stable versions.
If the error is not resolved, try running the pip install command with the —no-use-pep517 option.
If that didn’t help, try installing another version of python-ldap .
You can check the available versions of a package by running the pip install package== command.
The output contains a tuple of all of the versions of the package from the oldest to the most recent version.
Pick another version of the package and try installing it. Here is an example.
If that didn’t help, try creating a virtual environment.
Create a virtual environment #
To solve the «Could not build wheels for python-ldap» error:
- Create a virtual environment.
- Activate the virtual environment.
- Run the pip install command with the virtual environment active.
If the python3 -m venv venv command doesn’t work, try the following 2 commands:
- python -m venv venv
- py -m venv venv
Make sure to use the correct command to activate your virtual environment depending on your operating system and your shell.
Your virtual environment will use the version of Python that was used to create it.
Try running pip install in verbose mode #
If none of the suggestions helped, try running the pip install command in verbose mode.
The -v option stands for verbose mode and can be used up to 3 times.
When the pip install command is run in verbose mode, the command shows more output and how the error occurred.
Conclusion #
To solve the error «Could not build wheels for python-ldap», run the pip install —upgrade pip command to upgrade your pip version and rerun the pip install python-ldap command.
Источник
Unable to install on Windows 10: fatal error C1083: Cannot open include file: ‘lber.h’ #243
Unable to install on Windows 10, I tried
Issue description:
Whenever I run: pip install python-ldap
I get the following:
c:usersuserappdatalocaltemppip-install-652a07b0python-ldapmodulesconstants.h(7): fatal error C1083: Cannot open include file: ‘lber.h’: No such file or directory
error: command ‘C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.15.26726binHostX86x86cl.exe’ failed with exit status 2
Command «»c:program files (x86)python36-32python.exe» -u -c «import setuptools, tokenize;file=’C:UsersuserAppDataLocalTemppip-install-652a07b0python-ldapsetup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, file, ‘exec’))» install —record C:UsersuserAppDataLocalTemppip-record-09ceypm_install-record.txt —single-version-externally-managed —compile» failed with error code 1 in C:UsersuserAppDataLocalTemppip-install-652a07b0python-ldap
pyldap-3.0.0-py2.py3-none-any.whl is not a supported wheel on this platform.
- Also looked into requirements: https://www.python-ldap.org/en/latest/installing.html#build-prerequisites
I downloaded the OpenLDAP client libs but didn’t know where to place it’s folder ?
Steps to reproduce:
pip install python-ldap
Operating system: Windows 10, version 1803, OS Build 171134.285
Python version: Python 3.6.5
python-ldap version: None
Any ideas how to proceed ?
The text was updated successfully, but these errors were encountered:
Источник
Cant pip python-ldap on 3.6 #297
If you found a bug in python-ldap, or would request a new feature,
this is the place to let us know.
Please describe the issue and your environment here.
Im running in a docker env, single app single python instance 3.6 I cant deploy python-ldap in python3.6 env
Use the Python3.6 image
Set the working directory to /app
Copy the current directory contents into the container at /app
Install the dependencies
RUN pip3 install -r requirements.txt
run the command to start uWSGI
CMD [«uwsgi», «app.ini»]
Running setup.py install for python-ldap: started
Running setup.py install for python-ldap: finished with status ‘error’
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-ni8_pla_/python-ldap/setup.py’»‘»‘; file=’»‘»‘/tmp/pip-install-ni8_pla_/python-ldap/setup.py’»‘»‘;f=getattr(tokenize, ‘»‘»‘open’»‘»‘, open)(file);code=f.read().replace(‘»‘»‘rn’»‘»‘, ‘»‘»‘n’»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec’»‘»‘))’ install —record /tmp/pip-record-gma0a6c1/install-record.txt —single-version-externally-managed —compile
cwd: /tmp/pip-install-ni8_pla_/python-ldap/
Complete output (81 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying Lib/ldapurl.py -> build/lib.linux-x86_64-3.6
copying Lib/ldif.py -> build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/filter.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/dn.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/async.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/logger.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/functions.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/compat.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/init.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-3.6/ldap
copying Lib/ldap/constants.py -> build/lib.linux-x86_64-3.6/ldap
creating build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/init.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-3.6/ldap/controls
copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-3.6/ldap/controls
creating build/lib.linux-x86_64-3.6/ldap/extop
copying Lib/ldap/extop/init.py -> build/lib.linux-x86_64-3.6/ldap/extop
copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-3.6/ldap/extop
creating build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/init.py -> build/lib.linux-x86_64-3.6/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-3.6/ldap/schema
creating build/lib.linux-x86_64-3.6/slapdtest
copying Lib/slapdtest/slapdtest.py -> build/lib.linux-x86_64-3.6/slapdtest
copying Lib/slapdtest/init.py -> build/lib.linux-x86_64-3.6/slapdtest
running egg_info
writing Lib/python_ldap.egg-info/PKG-INFO
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
reading manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘Doc/.build’
writing manifest file ‘Lib/python_ldap.egg-info/SOURCES.txt’
creating build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-3.6/slapdtest/certs
copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-3.6/slapdtest/certs
running build_ext
building ‘ldap’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/Modules
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.2.0 -DLDAPMODULE_AUTHOR=python-ldap project -DLDAPMODULE_LICENSE=Python style -IModules -I/usr/local/include/python3.6m -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.6/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:8:
Modules/constants.h:7:10: fatal error: lber.h: No such file or directory
#include «lber.h»
^
compilation terminated.
error: command ‘gcc’ failed with exit status 1
—————————————-
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-ni8_pla/python-ldap/setup.py’»‘»‘; file=’»‘»‘/tmp/pip-install-ni8_pla/python-ldap/setup.py’»‘»‘;f=getattr(tokenize, ‘»‘»‘open’»‘»‘, open)(file);code=f.read().replace(‘»‘»‘rn’»‘»‘, ‘»‘»‘n’»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec’»‘»‘))’ install —record /tmp/pip-record-gma0a6c1/install-record.txt —single-version-externally-managed —compile Check the logs for full command output.
ERROR: Service ‘flask’ failed to build: The command ‘/bin/sh -c pip3 install -r requirements.txt’ returned a non-zero code: 1
i followed what was recommended in the following and no change
when I try to pip before launching docker-compose it clearly shows its installed
(env) root@pdc-mgmt-netauto:/home/administrator/app/flask# pip install python-ldap
Requirement already satisfied: python-ldap in ./env/lib/python3.6/site-packages (3.2.0)
Requirement already satisfied: pyasn1>=0.3.7 in ./env/lib/python3.6/site-packages (from python-ldap) (0.4.6)
Requirement already satisfied: pyasn1_modules>=0.1.5 in ./env/lib/python3.6/site-packages (from python-ldap) (0.2.6)
also lber.h is also installed
(env) root@pdc-mgmt-netauto:/home/administrator/app/flask# apt-file search lber.h
golang-openldap-dev: /usr/share/gocode/src/github.com/mqu/openldap/_docs/include/lber.h
libldap2-dev: /usr/include/lber.h
Operating system:
Ubuntu 18.04
Python version:
(env) root@pdc-mgmt-netauto:/home/administrator/app/flask# python -V
Python 3.6.8
python-ldap 3.2.0
Think thats what its getting, should be pulling the dependency for flask-simpleldap
not sure how too check
The text was updated successfully, but these errors were encountered:
Источник
Installing python-ldap¶
Installing from PyPI¶
The preferred point for downloading the “official” source distribution is the PyPI repository which supports installing via pip. For example:
For installing from PyPI, you will need the same Build prerequisites as when installing from source.
We do not currently provide pre-built packages (wheels).
Furthermore, python-ldap requires the modules pyasn1 and pyasn1-modules. pip will install these automatically.
Pre-built Binaries¶
Because distributions seem to be all over the place, this page tries to list all the current ones we know of.
Note that the python-ldap team is not responsible for the binary packages except the sources you can grab from the PyPI page. Also note that binary packages are most times not up to date. If you experience troubles with a binary package, it would be nice if you try to build a recent version of python-ldap before submitting a bug report to make sure you did not hit a problem already fixed in recent releases.
openSUSE Linux¶
Ships with python-ldap and there’s an additional download repository which contains builds of latest releases (see also OBS package).
Debian Linux¶
Have a look into the Debian Package Tracker to get up to date information which versions are available.
Windows¶
Unofficial packages for Windows are available on Christoph Gohlke’s page.
FreeBSD¶
The CVS repository of FreeBSD contains the package py-ldap
macOS¶
You can install directly with pip:
Installing from Source¶
python-ldap is built and installed using the Python setuptools. From a source repository:
If you have more than one Python interpreter installed locally, you should use the same one you plan to use python-ldap with.
Further instructions can be found in Setuptools documentation .
Build prerequisites¶
The following software packages are required to be installed on the local system when building python-ldap:
- Python version 2.7, or 3.4 or later including its development files
- C compiler corresponding to your Python version (on Linux, it is usually gcc )
- OpenLDAP client libs version 2.4.11 or later; it is not possible and not supported to build with prior versions.
- OpenSSL (optional)
- Cyrus SASL (optional)
- Kerberos libraries, MIT or Heimdal (optional)
Источник
When I run the following command:
sudo pip install python-ldap
I get this error:
In file included from Modules/LDAPObject.c:9:
Modules/errors.h:8: fatal error: lber.h: No such file or directory
Any ideas how to fix this?
The python-ldap (http://www.python-ldap.org/) is based on OpenLDAP, so you need to have the development files (headers) in order to compile the Python module. If you’re on Ubuntu, the package is called libldap2-dev
.
Debian/Ubuntu:
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
RedHat/CentOS:
sudo yum install python-devel openldap-devel
To install python-ldap successfully with pip, following development libraries are needed (package names taken from ubuntu environment):
sudo apt-get install -y python-dev libldap2-dev libsasl2-dev libssl-dev
On CentOS/RHEL 6, you need to install:
sudo yum install python-devel
sudo yum install openldap-devel
and yum will also install cyrus-sasl-devel
as a dependency. Then you can run:
pip-2.7 install python-ldap
In Ubuntu it looks like this :
$ sudo apt-get install python-dev libldap2-dev libsasl2-dev libssl-dev
$ sudo pip install python-ldap
«Don’t blindly remove/install software»
In a Ubuntu/Debian based distro, you could use apt-file
to find the name of the exact package that includes the missing header file.
# do this once
sudo apt-get install apt-file
sudo apt-file update
$ apt-file search lber.h
libldap2-dev: /usr/include/lber.h
As you could see from the output of apt-file search lber.h
, you’d just need to install the package libldap2-dev
.
sudo apt-get install libldap2-dev
Windows: I completely agree with the accepted answer, but digging through the comments took a while to get to the meat of what I needed. I ran across this specific problem with Reviewboard on Windows using the Bitnami. To give an answer for windows then, I used this link mentioned in the comments:
- http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap
- placed that wheel (whl file) into my reviewboard install directory
Then, executed the following commands
easy_install pip
pip install python_ldap-2.4.20-cp27-none_win32.whl
(because I had python 2.7 and a 32bit install at that)
easy_install python-ldap
For those having the same issue of missing Iber.h on Alpine Linux, in a docker image that you are trying to adapt to Alpine for instance.
The package you are looking for is: openldap-dev
So run
apk add openldap-dev
Available from version 3.3 up to Edge
Available for both armhf and x86_64 Architectures.
On Fedora 22, you need to do this instead:
sudo dnf install python-devel
sudo dnf install openldap-devel
sudo apt-get install build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev slapd ldap-utils python-tox lcov valgrind
- Debian Reference :
https://www.python-ldap.org/en/latest/installing.html#debian - For others: https://www.python-ldap.org/en/latest/installing.html
For alpine docker
apk add openldap-dev
if the python version is 3 and above try
pip install python3-ldap
On openSUSE you need to install the packages openldap2-devel
, cyrus-sasl-devel
, python-devel
and libopenssl-devel
.
zypper install openldap2-devel cyrus-sasl-devel python-devel libopenssl-devel
I had problems with the installation on Windows, so one of the solutions is to install the ldap
package manually.
A few steps:
- Go to the page pyldap or/and python-ldap and download the latest version
*whl
. - Open a console then cd to where you’ve downloaded your file like
some-package.whl
and use:
pip install some-package.whl
The current version for pyldap
is 2.4.45
. On a concrete example the installation would be:
pip install .pyldap-2.4.45-cp37-cp37m-win_amd64.whl
# or
pip install .python_ldap‑3.3.1‑cp39‑cp39‑win_amd64.whl
Output:
Installing collected packages: pyldap
Successfully installed pyldap-2.4.45
EDIT
You can install the proper version for Python-3.X though using following command:
# if pip3 is the default pip alias for python-3
pip3 install python3-ldap
# otherwise
pip install python3-ldap
Also here is the link of PiPy package for further information: python3-ldap 0.9.8.4
OR
ldap3 is a strictly RFC 4510 conforming LDAP V3 pure Python client library. The same codebase runs in Python 2, Python 3, PyPy and PyPy3: https://github.com/cannatag/ldap3
pip install ldap3
from ldap3 import Server, Connection, SAFE_SYNC
server = Server('my_server')
conn = Connection(server, 'my_user', 'my_password', client_strategy=SAFE_SYNC, auto_bind=True)
status, result, response, _ = conn.search('o=test', '(objectclass=*)')
# usually you don't need the original request (4th element of the returned tuple)
python3 does not support python-ldap. Rather to install ldap3.
On OSX, you need the xcode CLI tools. Just open a terminal and run:
xcode-select --install
For most systems, the build requirements are now mentioned in python-ldap’s documentation, in the «Installing» section.
If anything is missing for your system (or your system is missing entirely), please let maintainer know!
(As of 2018, I am the maintainer, so a comment here should be enough. Or you can send a pull request or mail.)
To correct the error due to dependencies to install the python-ldap : Windows 7/10
download the whl file
http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap.
python 3.6 suit with
python_ldap-3.2.0-cp36-cp36m-win_amd64.whl
Deploy the file in :
c:python36Scripts
install it with
python -m pip install python_ldap-3.2.0-cp36-cp36m-win_amd64.whl
In FreeBSD 11:
pkg install openldap-client # for lber.h
pkg install cyrus-sasl # if you need sasl.h
pip install python-ldap
As a general solution to install Python packages with binary dependencies [1] on Debian/Ubuntu:
sudo apt-get build-dep python-ldap
# installs system dependencies (but not the package itself)
pew workon my_virtualenv # enter your virtualenv
pip install python-ldap
You’ll have to check the name of your Python package on Ubuntu (http://packages.ubuntu.com/) versus PyPI. In this case they’re the same.
Obviously doesn’t work if the Python package is not in the Ubuntu repos.
[1] I learnt this trick when trying to pip install matplotlib
on Ubuntu.
For ArchLinux/Manjaro for me helped the following command:
yay libldap24
try:
ARCHFLAGS="-arch x86_64" pip3 install python-ldap
for those who are using alphine linux,
apk add openldap-dev
As of december 2021 there was/is a strange problem with the ldap library (at least in arch/manjaro).
While installing python-ldap
(at ‘Building wheel for python-ldap’) I got the message ‘ERROR: Failed building wheel for python-ldap’:
/usr/bin/ld: cannot find -lldap_r
collect2: error: ld returned 1 exit status
error: command '/usr/bin/gcc' failed with exit code 1
a workaround is provided here: https://github.com/python-ldap/python-ldap/issues/432#issuecomment-974799221
I cite:
As a workaround create the file /usr/lib64/libldap_r.so with content
INPUT ( libldap.so ). The approach works on all systems that use a GNU
ld-compatible linker.
# cat > /usr/lib64/libldap_r.so << EOF
INPUT ( libldap.so )
EOF
If you’re working with windows machines, you can find ‘python-ldap’ wheel in this Link and then you can install it
Adding also libzbar-dev
solved for me the installation of python-ldap
when building DOCKER
The full command becomes:
apt-get install -y python-dev libldap2-dev libsasl2-dev libssl-dev libzbar-dev
Comments Section
Thanks for that. It’s got further it’s now failing with sasl.h no such file or directory
@VacuumTube: Missing headers are almost always a sign for missing
-dev
packages (sometimes also named-devel
). Just doapt-cache search sasl | grep dev
and you’ll probably find the right package — I would guess it’slibsasl2-dev
.
Anything for windows users Same error, no solutions so far
You don’t have to compile from source on Windows. Just use one of the installers from pypi.python.org/pypi/python-ldap.
Also, Windows users can extract the .msi installer @Semmel mentioned to install into a virtualenv: How to install python-ldap on a python 2.7 virtualenv on windows without compiling (http://stackoverflow.com/questions/15918188/how-to-install-python-ldap-on-a-python-2-7-virtualenv-on-windows-without-compili) (see update 2)
stackoverflow.com/questions/15070063/…
Still true for F25
Thanks, might be worth noting that if you’re running python3, you would need python3-devel, rather than python-devel.
Good for alpine-based images. Thanks.
This should really be at the top. It’s extremely helpful.
Is there a CentoOS equivalent to this?
Can you please explain what this does?
It worked on Manjaro, thanks
Related Topics
python
module
ldap
Mentions
Community
Tono Kuriakose
Jonathan
Andi Dog
Mike Pennington
Vacuum Tube
Bhavesh Odedra
Jmu
Banjer
Abdoul Ndiaye
Jeff Sheffield
Gayan Weerakutti
Ilhicas
Chfw
Christian Berendt
Akhilraj N S
Thomas John
Agnel Amodia
Andy Fraley
Petr Viktorin
Lofidevops
Zifter
Vivin Veerali
Simas Joneliunas
Zain Mukati
Marco Cerliani
Mac Martin
References
4768446/i-cant-install-python-ldap
ubuntu 16.04 ,
sudo apt-get install -y python-dev libxml2-dev libxml2 libxslt-dev libpq-dev libldap2-dev libsasl2-dev libevent-dev #安装开发相关的库 sudo apt-get install -y libjpeg8-dev libpng12-dev libfreetype6-dev zlib1g-dev libwebp-dev libtiff5-dev libopenjpeg-dev libzip-dev #安装Pillow依赖包 sudo apt-get install -y python-babel python-dateutil python-decorator python-docutils python-feedparser python-imaging sudo apt-get install -y python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid sudo apt-get install -y python-passlib python-psutil python-psycopg2 python-pychart python-pydot python-pyparsing sudo apt-get install -y python-pypdf python-reportlab python-requests python-suds python-tz python-vatnumber python-vobject sudo apt-get install -y python-werkzeug python-xlsxwriter python-xlwt python-yaml python-gevent sudo apt-get install -y python-pip #安装pip,如果系统未安装
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_VERSION=431 -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o -o build/lib.linux-x86_64-2.7/psutil/_psutil_linux.so
/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
—————————————-
Failed building wheel for psutil
Running setup.py clean for psutil
Running setup.py bdist_wheel for psycopg2 … error
Complete output from command /usr/bin/python -u -c «import setuptools, tokenize;__file__=’/tmp/pip-build-c23zWr/psycopg2/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exec’))» bdist_wheel -d /tmp/tmpYWaNKdpip-wheel- —python-tag cp27:
running bdist_wheel
running build
«««
/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
—————————————-
Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Running setup.py bdist_wheel for python-ldap … error
Failed building wheel for python-ldap
running build_ext
building ‘lxml.etree’ extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lxml
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so
/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
—————————————-
Rolling back uninstall of lxml Command «/usr/bin/python -u -c «import setuptools, tokenize;__file__=’/tmp/pip-build-c23zWr/lxml/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exec’))» install —record /tmp/pip-9AcfMG-record/install-record.txt —single-version-externally-managed —compile» failed with error code 1 in /tmp/pip-build-c23zWr/lxml/
pip list
root@vagrant:/home/good# pip list DEPRECATION: The default format will switch to columns in the future. You can use —format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
Babel (2.3.4)
beautifulsoup4 (4.4.1)
bzr (2.7.0)
Chameleon (2.24)
chardet (2.3.0)
configobj (5.0.6)
cryptography (1.2.3)
Cython (0.25.2)
decorator (4.0.10)
distribute (0.6.14)
docutils (0.12)
docxtpl (0.3.5)
ecdsa (0.13)
enum34 (1.1.2)
feedparser (5.1.3)
funcsigs (0.4)
gevent (1.1.0)
greenlet (0.4.9)
gyp (0.1)
html5lib (0.999)
httplib2 (0.9.1)
idna (2.0)
ipaddress (1.0.16)
Jinja2 (2.8)
keyring (7.3)
launchpadlib (1.10.3)
lazr.restfulclient (0.13.4)
lazr.uri (1.0.3)
linecache2 (1.0.0)
lptools (0.2.0)
lxml (3.7.3)
Mako (1.0.3)
MarkupSafe (0.23)
mock (1.3.0)
ndg-httpsclient (0.4.0)
numpy (1.12.1)
oauth (1.0.1)
odoo (10.0.post20170601)
ofxparse (0.16)
paramiko (1.16.0)
passlib (1.6.5)
pbr (1.8.0)
pdfkit (0.6.1)
pdftools (0.37)
Pillow (3.1.2)
pip (9.0.1)
psutil (3.4.2)
psycogreen (1.0)
psycopg2 (2.6.1)
pyasn1 (0.1.9)
PyChart (1.39)
pycrypto (2.6.1)
pydot (1.0.29)
Pygments (2.1)
pygobject (3.20.0)
pygpgme (0.3)
pyinotify (0.9.6)
pyOpenSSL (0.15.1)
pyparsing (2.0.3)
pyPdf (1.13)
Pyrex (0.9.8.5)
pyserial (3.0.1)
pystan (2.15.0.1)
python-dateutil (2.4.2)
python-docx (0.8.6)
python-ldap (2.4.22)
Python-OOXML (0.13)
python-openid (2.2.5)
python-stdnum (1.2)
pytz (2016.7)
pyusb (1.0.0b2)
PyWebDAV (0.9.8)
pyxdg (0.25)
PyYAML (3.11)
reportlab (3.3.0)
requests (2.11.1)
roman (2.0.0)
SecretStorage (2.1.3)
setuptools (36.0.0)
simplejson (3.8.1)
six (1.10.0)
suds-jurko (0.7.dev0)
traceback2 (1.4.0)
unittest2 (1.1.0)
urllib3 (1.13.1)
uTidylib (0.2)
vatnumber (1.2)
vobject (0.8.1rc0)
wadllib (1.3.2)
Werkzeug (0.10.4)
wheel (0.29.0)
xlrd (1.0.0)
XlsxWriter (0.7.3)
xlutils (2.0.0)
xlwt (0.7.5)
zope.interface (4.1.3)
ZSI (2.1a1)
Lxml has been installed, but can not pass 。
1Ответ
Hi Patrick,
It seems installing order is not proper. Please uninstall everything and install it again. I hope that will solve your problem.
Thanks
Chandran nepolean
Add Answer
|
View In TPC Matrix
Technical Problem Cluster First Answered On
February 16, 2022
Popularity
8/10
Helpfulness
9/10
Contributions From The Grepper Developer Community
Contents
Code Examples
Related Problems
TPC Matrix View Full Screen
ERROR: Failed building wheel for python-ldap
Comment
0
Popularity
8/10 Helpfulness
9/10
Language
python
Source: stackoverflow.com
Tags: building
python
python-ldap
Contributed on Feb 16 2022
Graceful Gentoo
1 Answers Avg Quality 9/10
I’ve installed flask, flask_login, and ldap in the virtualenv for my flask package (to authenticate ldap users with the usernames & passwords of the other users at my company).
When I run my flask app, I get «AttributeError: ‘module’ object has no attribute ‘initialize'»
I’m tried «pip install python-ldap»
but I get a red error (sandwiched between other white text) that reads:
«Failed building wheel for python-ldap»
I have thoroughly examined these:
How to install python-ldap on a python 2.7 virtualenv on windows without compiling
Installing python-ldap in a virtualenv on Windows
https://www.python-ldap.org/docs.html
https://www.linuxjournal.com/article/6988?page=0,1
to no avail.
I’ve had this error for days now…
(also:
pip install openldap
gives:
Collecting openldap
Could not find a version that satisfies the requirement openldap (from versions: )
No matching distribution found for openldap
…(in and outside of my venv) if that information helps)
I had this error last week and after switching work computers, I recreated the virtualenv and installed all of the other packages and dependencies successfully.
my requirements.txt file contains these lines after a line of git stuff:
click==6.7
Flask==0.12.2
Flask-Login==0.4.0
itsdangerous==0.24
Jinja2==2.9.6
ldap==1.0.2
ldap3==2.2.4
MarkupSafe==1.0
pyasn1==0.2.3
Werkzeug==0.12.2
Has anyone successfully installed python-ldap into a flask virtualenv with windows? If so… how?!