Hi,
I'm a new Debian user - running version 12 (bookworm) on a Raspberry Pi 5
As part of an IoT course I am studying, I am trying to to install various python packages as part of the course projects.
Issue 1 - if I attempt to install a package via bash using the following command as an example "pip3 install azure-iot-hub" I receive the following error:
error: externally-managed-environment
This environment is externally managed
To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
For more information visit http://rptl.io/venv
Issue 2 - If I then create a venv and attempt the same command from within the venv, I get this error:
Building wheel for uamqp (pyproject.toml) did not run successfully.
exit code: 1
[157 lines of output]
(lines of output ommitted)
subprocess.CalledProcessError: Command 'cmake /tmp/pip-install-ovsdrchh/uamqp_d8001e6a03b84939a5d3649ddd365d75/src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_default_uuid:bool=ON -Duse_builtin_httpapi:bool=ON -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release' returned non-zero exit status 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
All debian packages are up to date (sudo apt update)....
The cmake package referenced in the error has been installed in the venv (pip3 install cmake)....
Can anyone help in moving past these errors please?
Thanks in advance
Matt
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Python] ERROR: Failed building wheel for uamqp
- ruwolf
- Posts: 643
- Joined: 2008-02-18 05:04
- Location: Banovce nad Bebravou
- Has thanked: 41 times
- Been thanked: 30 times
Re: [Python] ERROR: Failed building wheel for uamqp
Is there no log from it?
Or something more about kind and/or source of the error in omitted lines of output?
(BTW, there is regular Debian binary package cmake, can it not be used instead here?)
Or something more about kind and/or source of the error in omitted lines of output?
(BTW, there is regular Debian binary package cmake, can it not be used instead here?)
- bbbhltz
- Posts: 166
- Joined: 2024-01-10 14:53
- Location: Normandy
- XMMP/Jabber: bbbhltz@mailbox.org
- Has thanked: 49 times
- Been thanked: 33 times
Re: [Python] ERROR: Failed building wheel for uamqp
What if you follow the instructions here
https://pypi.org/project/uamqp/
before trying to install azure-iot-hub?
https://pypi.org/project/uamqp/
before trying to install azure-iot-hub?
bbbhltz
longtime desktop Linux user; eternal newbie
longtime desktop Linux user; eternal newbie
Re: [Python] ERROR: Failed building wheel for uamqp
I also run in the issue of 'externally managed environment'. The way that I deal with it:
- Check if package is available in Debian archive via apt and by searching packages.debian.org (for better pattern matching). If so, I install it system-wide.
- Run pip install with '--break-system-packages' option. It will install requested package in ~/.local/lib/python3.*/site_packages/ .
Code: Select all
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
- None1975
- df -h | participant
- Posts: 1412
- Joined: 2015-11-29 18:23
- Location: Russia, Kaliningrad
- Has thanked: 46 times
- Been thanked: 70 times
Re: [Python] ERROR: Failed building wheel for uamqp
No, that's bad. Too bad and it's not the Debian method. One way is to use the package pipx….Run pip install with '--break-system-packages' option
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github
Debian Wiki | DontBreakDebian, My config files on github
- bbbhltz
- Posts: 166
- Joined: 2024-01-10 14:53
- Location: Normandy
- XMMP/Jabber: bbbhltz@mailbox.org
- Has thanked: 49 times
- Been thanked: 33 times
Re: [Python] ERROR: Failed building wheel for uamqp
While I am no dev, programmer, or hacker, I have to concur with @None1975.
There is a reason why there is a warning about PEP 668.
There is a reason why there is a warning about PEP 668.
Debian, and other distros, made the decision to adopt this proposal. pipx or using a venv is the way to go.The breakage can occur for both system-wide pip installations (sudo pip install), as well as user installations (pip install --user), but especially the latter, since trying to recover from this might result in removing (using pip, not the distro package manager) packages installed using the Linux distribution's package manager.
— Source
bbbhltz
longtime desktop Linux user; eternal newbie
longtime desktop Linux user; eternal newbie