-
Notifications
You must be signed in to change notification settings - Fork 115
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
Version 0.9.0 cannot be installed via pip #414
Comments
What operating system are you using this on? |
Both Linux systems are running Ubuntu (version 20 or 22 I believe). |
PyGObject provides GLib and the async mainloop |
I can try to help but I need to know more. Why is GLib needed? |
I'm not quite sure I understand what you are looking for. I'll give some answers but please let me know if I have misunderstood what you want. You might want to start with the instructions for how to install the package. https://pygobject.gnome.org/getting_started.html#ubuntu-logo-ubuntu-debian-logo-debian As to why it is needed, a lot of Bluetooth functionality is asynchronous (e.g. Characteristics notifications or scanning for devices) and the BlueZ library (the official Bluetooth stack on Linux) that Bluezero builds on top of uses the GLib library. The async functionality comes from the "mainloop". More information at: https://docs.gtk.org/glib/main-loop.html |
This helps some, thank you! Perhaps my question should be, what does this library provide that core Python and the standard libraries do not? Async functionality is available within Python 3, for example. Looking at the diff between version 0.8.0 and 0.9.0, it doesn't appear that much has functionally changed. Was adding this dependency necessary in order to support the addition of tx-power in advertising requests? |
Perhaps this might help:
or this (which depends on the above anyway)
FYI: Using Python's asyncio would still require a way to call the native C API's for the GLib runtime (native async events that talk to a native main loop that get's proxied to Python, etc) that the PyGObject C Extension Module provides access to. The architecture: https://pygobject.gnome.org/ |
I think explicitly adding PyGObject brings in 1 or more dependancies that would sometimes not be available in a venv, but it's been a while so please don't quote me. |
Hi @erichiggins ,
Ah! OK, maybe I understand the confusion a little more. The dependency wasn't added in 0.9.0 because it was new functionality in that release. It was added to (mistakenly as it turns out) add more robustness to the dependency list. This is very much a work in progress. Made that more complex by the fact that Bluetooth relies heavily on low-level OS libraries that haven't historically been Bluezero has always had the goal of helping people get started with BlueZ and then possibly getting out of the way once people knew what they were doing. As result of this, connecting the asyncio event loop and the GLib event loop was never a goal. There are other libraries such as bleak that do make that connection. Bleak is a cross platform library so it was done to be consistent API across all platforms. |
Hi @WayneKeenan ,
I believe that the PyGObject project has done some work to make things more pip friendly these days and that is why I added the dependency. However, testing on different systems and different OSes is difficult for me. I'm hoping the more eyes we can get on this the more robust this will become over time 🤞 |
Hi @erichiggins ,
What CPU arch are you on? Is it Ubuntu Server or Desktop edition? |
For mine, Intel arch, Ubuntu Desktop (variant). |
I managed to replicate the error on a fresh AWS EC2 Ubuntu 24.04 LTS instance; a long story involving not have much success running VM's on my M1 Mac and also no RPi to hand. But, the steps below gets to the point of being able to successfully install The critical thing is to remove PyGObject from
Hope it helps from both a user and maintainer perspective. |
To resolve the original error I did this:
However, there is a further PyGObject dependancy on |
@WayneKeenan I was able to resolve the issue using
|
Hello,
The build system for my project, which depends on bluezero, started failing back in May when version 0.9.0 was released. The issue seems related to the new dependencies that were added, which cannot be installed on Linux systems for some reason.
To resolve the issue, I've had to pin to version 0.8.0.
The following is the error log from the build, which runs on Github actions, and I was able to reproduce locally in a clean Python 3.12 virtual environment by running
pip install bluezero
.The text was updated successfully, but these errors were encountered: