【问题标题】:Error when installing python ldap package安装python ldap包时出错
【发布时间】:2021-07-27 22:33:33
【问题描述】:

我正在尝试在 ubuntu 20.04 上安装 python-ldap

pip3 install python-ldap

它抱怨这个命令错误

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.

看起来有问题

x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’

在 Google 上搜索过,但没有多少关于这个典型错误的好答案。

我试图复制实际的命令并在本地运行它

/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

我得到以下输出

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'

它似乎试图写入/tmp 文件夹中的文件,但没有写入?

我尝试过的: 在 GOOGLE 和 SO 上搜索以安装额外建议的 apt 包,例如 build-essentials python3.8-dev libsasl2-dev python3-dev libldap2-dev libssl-dev 但没有解决我的问题。

【问题讨论】:

    标签: python-ldap


    【解决方案1】:

    没有直接回答我自己的问题,但我认为有一个 python 包python3-ldap 安装没有问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-01
      • 1970-01-01
      • 2014-12-15
      • 2023-04-11
      • 2022-10-26
      • 2021-06-17
      • 2018-08-17
      相关资源
      最近更新 更多