首页 > 解决方案 > 安装 dm.xmlsec.binding 时出现问题

问题描述

我正在尝试在Flask 应用程序中配置安全身份验证。

我正在使用python3.6并且想法是使用有效的安全身份验证。建议是使用SSO SAML 身份验证。我找到了一个似乎可以达到目的的登录工具包

在安装依赖项之一 - dm.xmlsec.binding - 我收到以下错误:

[user@fite1dava01 include]$ sudo pip3 install dm.xmlsec.binding
Collecting dm.xmlsec.binding
  Using cached https://files.pythonhosted.org/packages/56/30/7d19e02398b46593c7a72589c767c50f1ff4a96845f5bc6c61c3183fb213/dm.xmlsec.binding-2.0.tar.gz
Requirement already satisfied: setuptools in /usr/lib/python3.6/site-packages (from dm.xmlsec.binding)
Requirement already satisfied: lxml>=3.0 in /usr/local/lib64/python3.6/site-packages (from dm.xmlsec.binding)
Installing collected packages: dm.xmlsec.binding
  Running setup.py install for dm.xmlsec.binding ... error
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wric4vy0/dm.xmlsec.binding/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-k32jsbfl-record/install-record.txt --single-version-externally-managed --compile:
    /usr/lib64/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/dm
    copying dm/__init__.py -> build/lib.linux-x86_64-3.6/dm
    creating build/lib.linux-x86_64-3.6/dm/xmlsec
    copying dm/xmlsec/__init__.py -> build/lib.linux-x86_64-3.6/dm/xmlsec
    creating build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    copying dm/xmlsec/binding/tmpl.py -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    copying dm/xmlsec/binding/__init__.py -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    copying dm/xmlsec/binding/tests.py -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    running egg_info
    writing dm.xmlsec.binding.egg-info/PKG-INFO
    writing dependency_links to dm.xmlsec.binding.egg-info/dependency_links.txt
    writing namespace_packages to dm.xmlsec.binding.egg-info/namespace_packages.txt
    writing requirements to dm.xmlsec.binding.egg-info/requires.txt
    writing top-level names to dm.xmlsec.binding.egg-info/top_level.txt
    reading manifest file 'dm.xmlsec.binding.egg-info/SOURCES.txt'
    writing manifest file 'dm.xmlsec.binding.egg-info/SOURCES.txt'
    copying dm/xmlsec/binding/LICENSE.txt -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    copying dm/xmlsec/binding/README.txt -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    copying dm/xmlsec/binding/VERSION.txt -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    copying dm/xmlsec/binding/tests.txt -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding
    creating build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/deskey.bin -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/encrypt-element-tmpl.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/encrypt1-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/encrypt1-tmpl.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/encrypt2-doc.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/encrypt2-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/encrypt3-doc.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/encrypt3-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/rootcert.pem -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/rsacert.pem -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/rsakey.pem -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/rsapub.pem -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/sign1-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/sign1-tmpl.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/sign2-doc.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/sign2-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/sign3-doc.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/sign3-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/verify4-bad-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/verify4-bad-tmpl.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/verify4-res.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    copying dm/xmlsec/binding/resources/verify4-tmpl.xml -> build/lib.linux-x86_64-3.6/dm/xmlsec/binding/resources
    running build_ext
    building 'dm.xmlsec.binding._xmlsec' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -DXMLSEC_CRYPTO_OPENSSL=1 -I/usr/local/lib64/python3.6/site-packages/lxml -I/usr/local/lib64/python3.6/site-packages/lxml/includes -Isrc -I/usr/include/libxml2 -I/usr/include/xmlsec1 -I/usr/include/python3.6m -c src/_xmlsec.c -o build/temp.linux-x86_64-3.6/src/_xmlsec.o
    In file included from src/_xmlsec.c:626:
    /usr/local/lib64/python3.6/site-packages/lxml/includes/etree_defs.h:266:14: warning: ‘lxml_unpack_xmldoc_capsule’ defined but not used [-Wunused-function]
     static void* lxml_unpack_xmldoc_capsule(PyObject* capsule, int* is_owned) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
    gcc -pthread -shared -Wl,-z,relro -Wl,-z,now -g build/temp.linux-x86_64-3.6/src/_xmlsec.o -L/usr/ -L/usr/lib64 -L/usr/lib64 -lxml2 -lz -llzma -lm -ldl -lltdl -lxmlsec1-openssl -lxmlsec1 -lxslt -lssl -lcrypto -lpython3.6m -o build/lib.linux-x86_64-3.6/dm/xmlsec/binding/_xmlsec.cpython-36m-x86_64-linux-gnu.so
    /bin/ld: cannot find -lltdl
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wric4vy0/dm.xmlsec.binding/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-k32jsbfl-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-wric4vy0/dm.xmlsec.binding/

因此,由于这个错误,我也无法安装 python-saml

有人熟悉这个错误吗?

提前致谢

标签: python-3.xflasksaml

解决方案


推荐阅读