xmlsec / python-xmlsec

Python bindings for the XML Security Library.
MIT License
95 stars 99 forks source link

Not able to install xmlsec for Python2 in Mac OS. #276

Closed masterdungeon closed 7 months ago

masterdungeon commented 10 months ago

Error:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting xmlsec
  Using cached xmlsec-1.3.9.tar.gz (62 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: lxml>=3.8 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from xmlsec) (4.9.3)
Building wheels for collected packages: xmlsec
  Building wheel for xmlsec (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/lf/yggypbl96999g58h_wl_myqr0000gn/T/tmp8pz1Jj
       cwd: /private/var/folders/lf/yggypbl96999g58h_wl_myqr0000gn/T/pip-install-IUT_FR/xmlsec
  Complete output (112 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'src/xmlsec/__init__.py' not found (or not a regular file)
  creating build
  creating build/lib.macosx-10.9-x86_64-2.7
  creating build/lib.macosx-10.9-x86_64-2.7/xmlsec
  copying src/xmlsec/py.typed -> build/lib.macosx-10.9-x86_64-2.7/xmlsec
  copying src/xmlsec/tree.pyi -> build/lib.macosx-10.9-x86_64-2.7/xmlsec
  copying src/xmlsec/__init__.pyi -> build/lib.macosx-10.9-x86_64-2.7/xmlsec
  copying src/xmlsec/constants.pyi -> build/lib.macosx-10.9-x86_64-2.7/xmlsec
  copying src/xmlsec/template.pyi -> build/lib.macosx-10.9-x86_64-2.7/xmlsec
  running build_ext
  building 'xmlsec' extension
  creating build/temp.macosx-10.9-x86_64-2.7
  creating build/temp.macosx-10.9-x86_64-2.7/src
  gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/homebrew/etc/openssl@3/include -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_FTP=1 -DXMLSEC_NO_MD5=1 -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_CRYPTO_OPENSSL=1 -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.3.9 -I/opt/homebrew/Cellar/libxmlsec1/1.3.2/include/xmlsec1 -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/opt/openssl@3/include/openssl -I/private/var/folders/lf/yggypbl96999g58h_wl_myqr0000gn/T/pip-build-env-FFSGiE/normal/lib/python2.7/site-packages/lxml/includes -I/private/var/folders/lf/yggypbl96999g58h_wl_myqr0000gn/T/pip-build-env-FFSGiE/normal/lib/python2.7/site-packages/lxml -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/constants.c -o build/temp.macosx-10.9-x86_64-2.7/src/constants.o -g -std=c99 -fPIC -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os
  src/constants.c:321:5: error: use of undeclared identifier 'xmlSecXkmsNs'
      PYXMLSEC_ADD_NS_CONSTANT(XkmsNs, "XKMS");
      ^
  src/constants.c:311:45: note: expanded from macro 'PYXMLSEC_ADD_NS_CONSTANT'
      tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \
                                              ^
  src/common.h:19:19: note: expanded from macro 'JOIN'
  #define JOIN(X,Y) DO_JOIN1(X,Y)
                    ^
  src/common.h:20:23: note: expanded from macro 'DO_JOIN1'
  #define DO_JOIN1(X,Y) DO_JOIN2(X,Y)
                        ^
  src/common.h:21:23: note: expanded from macro 'DO_JOIN2'
  #define DO_JOIN2(X,Y) X##Y
                        ^
  <scratch space>:186:1: note: expanded from here
  xmlSecXkmsNs
  ^
  src/constants.c:326:5: error: use of undeclared identifier 'xmlSecSoap11Ns'
      PYXMLSEC_ADD_NS_CONSTANT(Soap11Ns, "SOAP11");
      ^
  src/constants.c:311:45: note: expanded from macro 'PYXMLSEC_ADD_NS_CONSTANT'
      tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \
                                              ^
  src/common.h:19:19: note: expanded from macro 'JOIN'
  #define JOIN(X,Y) DO_JOIN1(X,Y)
                    ^
  src/common.h:20:23: note: expanded from macro 'DO_JOIN1'
  #define DO_JOIN1(X,Y) DO_JOIN2(X,Y)
                        ^
  src/common.h:21:23: note: expanded from macro 'DO_JOIN2'
  #define DO_JOIN2(X,Y) X##Y
                        ^
  <scratch space>:194:1: note: expanded from here
  xmlSecSoap11Ns
  ^
  src/constants.c:327:5: error: use of undeclared identifier 'xmlSecSoap12Ns'; did you mean 'xmlSecXPath2Ns'?
      PYXMLSEC_ADD_NS_CONSTANT(Soap12Ns, "SOAP12");
      ^
  src/constants.c:311:45: note: expanded from macro 'PYXMLSEC_ADD_NS_CONSTANT'
      tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \
                                              ^
  src/common.h:19:19: note: expanded from macro 'JOIN'
  #define JOIN(X,Y) DO_JOIN1(X,Y)
                    ^
  src/common.h:20:23: note: expanded from macro 'DO_JOIN1'
  #define DO_JOIN1(X,Y) DO_JOIN2(X,Y)
                        ^
  src/common.h:21:23: note: expanded from macro 'DO_JOIN2'
  #define DO_JOIN2(X,Y) X##Y
                        ^
  <scratch space>:196:1: note: expanded from here
  xmlSecSoap12Ns
  ^
  /opt/homebrew/Cellar/libxmlsec1/1.3.2/include/xmlsec1/xmlsec/strings.h:34:33: note: 'xmlSecXPath2Ns' declared here
  XMLSEC_EXPORT_VAR const xmlChar xmlSecXPath2Ns[];
                                  ^
  src/constants.c:513:5: error: use of undeclared identifier 'xmlSecOpenSSLTransformHmacMd5Id'
      PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformHmacMd5, "HMAC_MD5");
      ^
  src/constants.c:468:33: note: expanded from macro 'PYXMLSEC_ADD_TRANSFORM_CONSTANT'
      tmp = PyXmlSec_TransformNew(xmlSec ## name ## Id); \
                                  ^
  <scratch space>:17:1: note: expanded from here
  xmlSecTransformHmacMd5Id
  ^
  /opt/homebrew/Cellar/libxmlsec1/1.3.2/include/xmlsec1/xmlsec/openssl/symbols.h:91:49: note: expanded from macro 'xmlSecTransformHmacMd5Id'
  #define xmlSecTransformHmacMd5Id                xmlSecOpenSSLTransformHmacMd5Id
                                                  ^
  src/constants.c:523:5: error: use of undeclared identifier 'xmlSecOpenSSLTransformRsaMd5Id'
      PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformRsaMd5, "RSA_MD5");
      ^
  src/constants.c:468:33: note: expanded from macro 'PYXMLSEC_ADD_TRANSFORM_CONSTANT'
      tmp = PyXmlSec_TransformNew(xmlSec ## name ## Id); \
                                  ^
  <scratch space>:38:1: note: expanded from here
  xmlSecTransformRsaMd5Id
  ^
  /opt/homebrew/Cellar/libxmlsec1/1.3.2/include/xmlsec1/xmlsec/openssl/symbols.h:102:49: note: expanded from macro 'xmlSecTransformRsaMd5Id'
  #define xmlSecTransformRsaMd5Id                 xmlSecOpenSSLTransformRsaMd5Id
                                                  ^
  src/constants.c:535:5: error: use of undeclared identifier 'xmlSecOpenSSLTransformMd5Id'
      PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformMd5, "MD5");
      ^
  src/constants.c:468:33: note: expanded from macro 'PYXMLSEC_ADD_TRANSFORM_CONSTANT'
      tmp = PyXmlSec_TransformNew(xmlSec ## name ## Id); \
                                  ^
  <scratch space>:65:1: note: expanded from here
  xmlSecTransformMd5Id
  ^
  /opt/homebrew/Cellar/libxmlsec1/1.3.2/include/xmlsec1/xmlsec/openssl/symbols.h:99:49: note: expanded from macro 'xmlSecTransformMd5Id'
  #define xmlSecTransformMd5Id                    xmlSecOpenSSLTransformMd5Id
                                                  ^
  6 errors generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for xmlsec
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec which use PEP 517 and cannot be installed directly

Below Packages are already Installed:

==> openssl@3: stable 3.2.0 (bottled) ==> libxmlsec1: stable 1.3.2 (bottled) ==> pkg-config: stable 0.29.2 (bottled)

deronnax commented 8 months ago

Python 2 support has been dropped years ago. And your pip selected a 3 year old version of xmlsec, anyway.

mxamin commented 7 months ago

@masterdungeon As @deronnax mentioned py2 is completely deprecated and we won't support that any more.