I am trying to install python-ldap on ubuntu 20.04
pip3 install python-ldap
It complains about this command error
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 -fwrapv -O2 -Qunused-arguments -Qunused-arguments -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/jlin/virtualenvs/pmas/include -I/usr/include/python3.8 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.8/Modules/LDAPObject.o
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/jlin/virtualenvs/pmas/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mw_idota/python-ldap_10d1d5b1c1324cd5b7e42a23e6d0db58/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mw_idota/python-ldap_10d1d5b1c1324cd5b7e42a23e6d0db58/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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-dfol907l/install-record.txt --single-version-externally-managed --compile --install-headers /home/jlin/virtualenvs/pmas/include/site/python3.8/python-ldap Check the logs for full command output.
Looks like problem with
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’
Searched on Google but not many good answers about this typical error.
I have tried to copied the actual command and run it locally
/home/jlin/virtualenvs/pmas/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mw_idota/python-ldap_10d1d5b1c1324cd5b7e42a23e6d0db58/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mw_idota/python-ldap_10d1d5b1c1324cd5b7e42a23e6d0db58/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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-dfol907l/install-record.txt --single-version-externally-managed --compile --install-headers /home/jlin/virtualenvs/pmas/include/site/python3.8/python-ldap
I got the following output
running install
running build
running install_egg_info
running egg_info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
removing '/home/jlin/virtualenvs/pmas/lib/python3.8/site-packages/UNKNOWN-0.0.0-py3.8.egg-info' (and everything under it)
Copying UNKNOWN.egg-info to /home/jlin/virtualenvs/pmas/lib/python3.8/site-packages/UNKNOWN-0.0.0-py3.8.egg-info
running install_scripts
writing list of installed files to '/tmp/pip-record-dfol907l/install-record.txt'
error: [Errno 2] No such file or directory: '/tmp/pip-record-dfol907l/install-record.txt'
It looks like it was trying to write to a file in /tmp folder but it didnt?
What I have tried:
Searched on GOOGLE and SO to installed extra suggested apt packages, such as build-essentials python3.8-dev libsasl2-dev python3-dev libldap2-dev libssl-dev
but did not solve my problem.