Satnam Sandhu
Satnam Sandhu

Reputation: 680

Failed building wheel for xmlsec

Trying to install Posthog, pip installation fails while creating wheel for xmlsec with the following error:

Building wheels for collected packages: pyyaml, xmlsec
  Building wheel for pyyaml (pyproject.toml) ... done
  Created wheel for pyyaml: filename=PyYAML-6.0-cp38-cp38-macosx_10_14_arm64.whl size=45338 sha256=fc1069bd2dcdd9d7f47f2d2faba20f111af7eb5dbc1b3fa445b971c643e9f8e4
  Stored in directory: /Users/saranshagarwal/Library/Caches/pip/wheels/52/84/66/50912fd7bf1639a31758e40bd4312602e104a8eca1e0da9645
  Building wheel for xmlsec (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for xmlsec (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.14-arm64-cpython-38
      creating build/lib.macosx-10.14-arm64-cpython-38/xmlsec
      copying src/xmlsec/py.typed -> build/lib.macosx-10.14-arm64-cpython-38/xmlsec
      copying src/xmlsec/tree.pyi -> build/lib.macosx-10.14-arm64-cpython-38/xmlsec
      copying src/xmlsec/__init__.pyi -> build/lib.macosx-10.14-arm64-cpython-38/xmlsec
      copying src/xmlsec/constants.pyi -> build/lib.macosx-10.14-arm64-cpython-38/xmlsec
      copying src/xmlsec/template.pyi -> build/lib.macosx-10.14-arm64-cpython-38/xmlsec
      running build_ext
      building 'xmlsec' extension
      creating build/temp.macosx-10.14-arm64-cpython-38
      creating build/temp.macosx-10.14-arm64-cpython-38/private
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var/folders
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var/folders/b0
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7/xmlsec_d0d430f1016e47f88c6c0edb21c82e85
      creating build/temp.macosx-10.14-arm64-cpython-38/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7/xmlsec_d0d430f1016e47f88c6c0edb21c82e85/src
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I /opt/homebrew/opt/openssl/include -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_SIZE_T -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.12 -I/opt/homebrew/Cellar/libxmlsec1/1.2.34_1/include/xmlsec1 -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/[email protected]/include/openssl -I/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-build-env-vytaqq0a/normal/lib/python3.8/site-packages/lxml/includes -I/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-build-env-vytaqq0a/normal/lib/python3.8/site-packages/lxml -I/Users/saranshagarwal/Workstation/posthog/env/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c /private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7/xmlsec_d0d430f1016e47f88c6c0edb21c82e85/src/constants.c -o build/temp.macosx-10.14-arm64-cpython-38/private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7/xmlsec_d0d430f1016e47f88c6c0edb21c82e85/src/constants.o -g -std=c99 -fPIC -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os
      In file included from /private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7/xmlsec_d0d430f1016e47f88c6c0edb21c82e85/src/constants.c:11:
      In file included from /private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7/xmlsec_d0d430f1016e47f88c6c0edb21c82e85/src/constants.h:13:
      /private/var/folders/b0/3bqprk097hl33cl_byclp6pc0000gn/T/pip-install-k8uaecy7/xmlsec_d0d430f1016e47f88c6c0edb21c82e85/src/platform.h:16:10: fatal error: 'Python.h' file not found
      #include <Python.h>
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' 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 xmlsec
Successfully built pyyaml
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects

Here is my requirement files:

#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
#    pip-compile requirements.in
#
aiohttp==3.8.1
    # via geoip2
aiosignal==1.2.0
    # via aiohttp
amqp==2.6.0
    # via
    #   -r requirements.in
    #   kombu
asgiref==3.3.2
    # via django
async-generator==1.10
    # via
    #   trio
    #   trio-websocket
async-timeout==4.0.2
    # via
    #   aiohttp
    #   redis
attrs==21.4.0
    # via
    #   aiohttp
    #   jsonschema
    #   outcome
    #   trio
backoff==1.6.0
    # via posthoganalytics
billiard==3.6.3.0
    # via celery
boto3==1.21.29
    # via -r requirements.in
botocore==1.24.46
    # via
    #   boto3
    #   s3transfer
celery==4.4.7
    # via
    #   -r requirements.in
    #   celery-redbeat
celery-redbeat==2.0.0
    # via -r requirements.in
certifi==2019.11.28
    # via
    #   requests
    #   sentry-sdk
    #   urllib3
cffi==1.14.5
    # via cryptography
chardet==3.0.4
    # via requests
charset-normalizer==2.1.0
    # via aiohttp
clickhouse-driver==0.2.1
    # via
    #   -r requirements.in
    #   clickhouse-pool
clickhouse-pool==0.5.3
    # via -r requirements.in
cryptography==37.0.2
    # via
    #   kafka-helper
    #   pyopenssl
    #   social-auth-core
    #   urllib3
cssselect==1.1.0
    # via toronado
cssutils==1.0.2
    # via toronado
dataclasses-json==0.5.7
    # via -r requirements.in
defusedxml==0.6.0
    # via
    #   -r requirements.in
    #   python3-openid
    #   social-auth-core
deprecated==1.2.13
    # via redis
dj-database-url==0.5.0
    # via -r requirements.in
django==3.2.15
    # via
    #   -r requirements.in
    #   django-axes
    #   django-cors-headers
    #   django-deprecate-fields
    #   django-extensions
    #   django-filter
    #   django-picklefield
    #   django-redis
    #   django-rest-hooks
    #   django-structlog
    #   djangorestframework
    #   djangorestframework-dataclasses
    #   drf-spectacular
django-axes==5.9.0
    # via -r requirements.in
django-cors-headers==3.5.0
    # via -r requirements.in
django-deprecate-fields==0.1.1
    # via -r requirements.in
django-extensions==3.1.2
    # via -r requirements.in
django-filter==2.4.0
    # via -r requirements.in
django-ipware==3.0.2
    # via
    #   django-axes
    #   django-structlog
django-loginas==0.3.9
    # via -r requirements.in
django-picklefield==3.0.1
    # via -r requirements.in
django-prometheus==2.2.0
    # via -r requirements.in
django-redis==5.2.0
    # via -r requirements.in
django-rest-hooks @ git+https://github.com/zapier/[email protected]
    # via -r requirements.in
django-statsd==2.5.2
    # via -r requirements.in
django-structlog==2.1.3
    # via -r requirements.in
djangorestframework==3.12.2
    # via
    #   -r requirements.in
    #   djangorestframework-csv
    #   djangorestframework-dataclasses
    #   drf-exceptions-hog
    #   drf-extensions
    #   drf-spectacular
djangorestframework-csv==2.1.1
    # via -r requirements.in
djangorestframework-dataclasses==1.1.1
    # via -r requirements.in
dnspython==2.2.1
    # via -r requirements.in
drf-exceptions-hog==0.2.0
    # via -r requirements.in
drf-extensions==0.7.0
    # via -r requirements.in
drf-spectacular==0.21.1
    # via -r requirements.in
frozenlist==1.3.0
    # via
    #   aiohttp
    #   aiosignal
future==0.18.2
    # via lzstring
geoip2==4.6.0
    # via -r requirements.in
google-cloud-sqlcommenter==2.0.0
    # via -r requirements.in
gunicorn==20.1.0
    # via -r requirements.in
h11==0.13.0
    # via wsproto
idna==2.8
    # via
    #   -r requirements.in
    #   requests
    #   trio
    #   urllib3
    #   yarl
importlib-metadata==1.6.0
    # via -r requirements.in
importlib-resources==5.9.0
    # via jsonschema
infi-clickhouse-orm @ git+https://github.com/PostHog/infi.clickhouse_orm@37722f350f3b449bbcd6564917c436b0d93e796f
    # via -r requirements.in
inflection==0.5.1
    # via drf-spectacular
iso8601==0.1.12
    # via infi-clickhouse-orm
isodate==0.6.1
    # via python3-saml
jmespath==1.0.0
    # via
    #   boto3
    #   botocore
jsonschema==4.4.0
    # via drf-spectacular
kafka-helper==0.2
    # via -r requirements.in
kafka-python==2.0.2
    # via -r requirements.in
kombu==4.6.10
    # via
    #   -r requirements.in
    #   celery
lxml==4.6.5
    # via
    #   python3-saml
    #   toronado
    #   xmlsec
lzstring==1.0.4
    # via -r requirements.in
marshmallow==3.15.0
    # via
    #   dataclasses-json
    #   marshmallow-enum
marshmallow-enum==1.5.1
    # via dataclasses-json
maxminddb==2.2.0
    # via geoip2
mimesis==5.2.1
    # via -r requirements.in
monotonic==1.5
    # via posthoganalytics
multidict==6.0.2
    # via
    #   aiohttp
    #   yarl
mypy-extensions==0.4.3
    # via typing-inspect
numpy==1.23.3
    # via -r requirements.in
oauthlib==3.1.0
    # via
    #   requests-oauthlib
    #   social-auth-core
outcome==1.1.0
    # via trio
packaging==21.3
    # via
    #   marshmallow
    #   redis
parso==0.8.1
    # via -r requirements.in
pexpect==4.7.0
    # via -r requirements.in
pickleshare==0.7.5
    # via -r requirements.in
posthoganalytics==2.1.2
    # via -r requirements.in
prometheus-client==0.14.1
    # via django-prometheus
psycopg2-binary==2.8.6
    # via -r requirements.in
ptyprocess==0.6.0
    # via pexpect
pycparser==2.20
    # via cffi
pyjwt==2.4.0
    # via
    #   -r requirements.in
    #   social-auth-core
pyopenssl==22.0.0
    # via urllib3
pyparsing==3.0.7
    # via packaging
pyrsistent==0.18.1
    # via jsonschema
pysocks==1.7.1
    # via urllib3
python-dateutil==2.8.1
    # via
    #   -r requirements.in
    #   botocore
    #   celery-redbeat
    #   posthoganalytics
python-statsd==2.1.0
    # via django-statsd
python3-openid==3.1.0
    # via social-auth-core
python3-saml==1.12.0
    # via -r requirements.in
pytz==2021.1
    # via
    #   -r requirements.in
    #   celery
    #   clickhouse-driver
    #   django
    #   infi-clickhouse-orm
    #   tzlocal
pyyaml==6.0
    # via drf-spectacular
redis==4.3.4
    # via
    #   -r requirements.in
    #   celery-redbeat
    #   django-redis
requests==2.25.1
    # via
    #   -r requirements.in
    #   django-rest-hooks
    #   geoip2
    #   infi-clickhouse-orm
    #   posthoganalytics
    #   requests-oauthlib
    #   social-auth-core
    #   webdriver-manager
requests-oauthlib==1.3.0
    # via
    #   -r requirements.in
    #   social-auth-core
s3transfer==0.5.2
    # via boto3
selenium==4.1.5
    # via -r requirements.in
semantic-version==2.8.5
    # via -r requirements.in
sentry-sdk==1.7.0
    # via -r requirements.in
six==1.16.0
    # via
    #   djangorestframework-csv
    #   isodate
    #   posthoganalytics
    #   python-dateutil
    #   tenacity
slack-sdk==3.17.1
    # via -r requirements.in
sniffio==1.2.0
    # via trio
social-auth-app-django==5.0.0
    # via -r requirements.in
social-auth-core==4.1.0
    # via
    #   -r requirements.in
    #   social-auth-app-django
sortedcontainers==2.4.0
    # via trio
sqlparse==0.4.2
    # via
    #   -r requirements.in
    #   django
statshog==1.0.6
    # via -r requirements.in
structlog==21.2.0
    # via django-structlog
tenacity==6.1.0
    # via celery-redbeat
toronado==0.1.0
    # via -r requirements.in
trio==0.20.0
    # via
    #   selenium
    #   trio-websocket
trio-websocket==0.9.2
    # via selenium
typing-extensions==4.1.1
    # via typing-inspect
typing-inspect==0.7.1
    # via dataclasses-json
tzlocal==2.1
    # via clickhouse-driver
unicodecsv==0.14.1
    # via djangorestframework-csv
uritemplate==4.1.1
    # via drf-spectacular
urllib3[secure,socks]==1.26.5
    # via
    #   botocore
    #   geoip2
    #   requests
    #   selenium
    #   sentry-sdk
vine==1.3.0
    # via
    #   amqp
    #   celery
webdriver-manager==3.5.4
    # via -r requirements.in
whitenoise==5.2.0
    # via -r requirements.in
wrapt==1.14.1
    # via deprecated
wsproto==1.1.0
    # via trio-websocket
xmlsec==1.3.12
    # via python3-saml
yarl==1.7.2
    # via aiohttp
zipp==3.1.0
    # via
    #   importlib-metadata
    #   importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools

Tried out several answers, but nothing I think the path is not getting updated after installing the packages from Homebrew.

Upvotes: 0

Views: 3745

Answers (1)

RustyPython
RustyPython

Reputation: 530

Looking at the pypi page for xmlsec https://pypi.org/project/xmlsec/

On MacOs it says you need to install

  • libxml2 >= 2.9.1
  • libxmlsec1 >= 1.2.18

To build package, which aren't in your requirements, maybe that's why the wheel is failing ?

Upvotes: 1

Related Questions