Azure / azure-iot-hub-python

Azure IoT Hub Data Plane Python SDK
MIT License
14 stars 10 forks source link

Install fails because uamqp wheel build fails #14

Open waku1123 opened 3 months ago

waku1123 commented 3 months ago

I want to install azure-iot-hub in a virtual environment (pip install azure-iot-hub), but the build of uamqp wheel fails. Is there something wrong with the installation method?

M2 Pro MacOS 14.4.1 python 3.9.17

      uamqp/c_uamqp.c:90791:109: warning: passing 'const IO_INTERFACE_DESCRIPTION *' (aka 'const struct IO_INTERFACE_DESCRIPTION_TAG *') to parameter of type 'IO_INTERFACE_DESCRIPTION *' (aka 'struct IO_INTERFACE_DESCRIPTION_TAG *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_2 = ((struct __pyx_vtabstruct_5uamqp_7c_uamqp_XIO *)__pyx_v_xio->__pyx_vtab)->create(__pyx_v_xio, __pyx_v_interface, ((PyObject *)__pyx_v_io_config), (&__pyx_v_io_config->_c_value)); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 39, __pyx_L1_error)
                                                                                                                  ^~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:111209:3: warning: unused label 'bad' [-Wunused-label]
        bad:
        ^~~~
      35 warnings and 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 uamqp
Failed to build uamqp
ERROR: Could not build wheels for uamqp, which is required to install pyproject.toml-based projects
birddevelper commented 2 months ago

azure-iot-hub depends on azure-uamqp-python package which is deprecated and fails to build on certain systems including Mac ARM and Linux ARM on Python 3.12+.

As a stopgap, I developed an small alternative package azure-iot-hub-api that has basic functionalities to use in my own project until the azure-iot-hub receive necessary updates. I tired to keep it as similar as possible to azure-iot-hub.

Also, there exits another package azure-iot-sdk-python which I haven't used, maybe it helps.