Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails because uamqp wheel build fails #14

Open
waku1123 opened this issue Apr 2, 2024 · 9 comments
Open

Install fails because uamqp wheel build fails #14

waku1123 opened this issue Apr 2, 2024 · 9 comments

Comments

@waku1123
Copy link

waku1123 commented Apr 2, 2024

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
Copy link

birddevelper commented Apr 21, 2024

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.

@timozerrer
Copy link

How is there still no official solution? @cartertinney , is this SDK discontinued?

@sugawarayss
Copy link

sugawarayss commented Aug 28, 2024

it looks like this package is not maintained...

I took advantage of this package’s functionality by ignoring build errors. Because only some features were needed.

CFLAGS="-Wno-error=incompatible-function-pointer-types" pip install azure-iot-hub

@timozerrer
Copy link

Thank you @sugawarayss . Are you aware which features are affected?

@sugawarayss
Copy link

sugawarayss commented Aug 28, 2024

@timozerrer
I don’t know if this is correct, but I think it probably affects the part where C2D messages are sent. However, I was able to send C2D messages even if I ignored the build error on my device local.

@timozerrer
Copy link

This workaround does not seem to work on Python 3.12: Azure/azure-uamqp-python#386 (comment)
I can confirm build is still not running using Python 3.12 and M3

@sugawarayss
Copy link

fmmm...
i use Python 3.9.17 on M2 MacOS device...

@abhimanyusinghal
Copy link

abhimanyusinghal commented Nov 6, 2024

Is there any official update on this issue. This is really big gap for anyone using Mac as a development machine. Python SDKs are supposed to be fully cross platform.
cc @cartertinney @microsoftopensource

@jeronimoagullo
Copy link

Hi! I am facing the same issue when using the az cli tools in Windows PC:

az iot hub monitor-events --hub-name {}

It tries to update uamqp but fails always:

Updating required dependency...
Failure updating uamqp. Aborting...
Collecting uamqp~=1.2
  Downloading uamqp-1.6.11.tar.gz (4.6 MB)
     ---------------------------------------- 4.6/4.6 MB 46.4 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\cli\base_command.py", line 105, in _run_wrapper
    status = _inner_run()
             ^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\cli\base_command.py", line 96, in _inner_run
    return self.run(options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\commands\install.py", line 379, in run
    requirement_set = resolver.resolve(
                      ^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_vendor\resolvelib\structs.py", line 156, in __bool__
    return bool(self._sequence)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 174, in __bool__
    return any(self)
           ^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 162, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
                       ^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 53, in _iter_built
    candidate = func()
                ^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 187, in _make_candidate_from_link
    base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 233, in _make_base_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
                                       ^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 304, in __init__
    super().__init__(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 159, in __init__
    self.dist = self._prepare()
                ^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 236, in _prepare
    dist = self._prepare_distribution()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 315, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\operations\prepare.py", line 527, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\operations\prepare.py", line 642, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\operations\prepare.py", line 72, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\distributions\sdist.py", line 56, in prepare_distribution_metadata
    self._install_build_reqs(finder)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\distributions\sdist.py", line 126, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\distributions\sdist.py", line 103, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_internal\utils\misc.py", line 701, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 321, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "C:\AppData\Local\Temp\pip-build-env-31mactz0\overlay\Lib\site-packages\setuptools\__init__.py", line 27, in <module>
    from .dist import Distribution
  File "C:\AppData\Local\Temp\pip-build-env-31mactz0\overlay\Lib\site-packages\setuptools\dist.py", line 19, in <module>
    from . import (
  File "C:\AppData\Local\Temp\pip-build-env-31mactz0\overlay\Lib\site-packages\setuptools\_entry_points.py", line 6, in <module>
    from jaraco.text import yield_lines
  File "C:\AppData\Local\Temp\pip-build-env-31mactz0\overlay\Lib\site-packages\setuptools\_vendor\jaraco\text\__init__.py", line 12, in <module>
    from jaraco.context import ExceptionTrap
  File "C:\AppData\Local\Temp\pip-build-env-31mactz0\overlay\Lib\site-packages\setuptools\_vendor\jaraco\context.py", line 11, in <module>
    import urllib.request
  File "urllib\request.py", line 88, in <module>
  File "http\client.py", line 71, in <module>
  File "email\parser.py", line 12, in <module>
  File "email\feedparser.py", line 27, in <module>
  File "email\_policybase.py", line 9, in <module>
  File "email\utils.py", line 29, in <module>
  File "socket.py", line 52, in <module>
ModuleNotFoundError: No module named '_socket'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants