Skip to content

Conversation

@dhs-rec
Copy link
Contributor

@dhs-rec dhs-rec commented Jun 3, 2025

This fixes #7173.

@khushboovashi
Copy link
Contributor

Hi @dhs-rec,

The dbus-python is the indirect dependency of keyring (Ref:https://pypi.org/project/keyring/). The author of the keyring package mentioned that "On Linux, the KWallet backend relies on dbus-python, which does not always install correctly when using pip (compilation is needed). For best results, install dbus-python as a system package."

So, we are already installing python3-dbus as a pgAdmin dependency. Please check while installing pgAdmin whether this dependency is getting installed on your system or not.

@dhs-rec
Copy link
Contributor Author

dhs-rec commented Jun 4, 2025

Yes, python3-dbus IS installed as a system package. But that doesn't matter (as I already wrote in the ticket), because the pgadmin4 Debian package ships a complete Python virtual environment, which isn't allowed to access system Python packages. Hence, dbus-python needs to be installed into the Python virtual environment that is contained in the pgadmin4 Debian package. See /usr/share/doc/python3.11/README.venv and PEP-668 for the details.

@dhs-rec
Copy link
Contributor Author

dhs-rec commented Jun 4, 2025

As an alternative solution, from above README:

If needed, the isolated environment can also have access to system Python
modules, with the "--system-site-packages" flag.

This flag must be provided when creating the Python virtual environment.

@khushboovashi
Copy link
Contributor

khushboovashi commented Jun 5, 2025

@dhs-rec, do you have any specific installation? We test on Debian Bookworm and have never faced this issue. Also, as you can see, GitHub actions are failing with your PR.

@dhs-rec
Copy link
Contributor Author

dhs-rec commented Jun 5, 2025

No, plain Debian Bookworm, as stated in the ticket.

I'll look into the failing actions...

@dhs-rec
Copy link
Contributor Author

dhs-rec commented Jun 5, 2025

Hmm, can't see any tests on Debian Bookworm. I only see Ubuntu 22.04 (when it comes to Linux). But PEP-668 was only enabled as of Ubuntu 23.04 (and Debian Bookworm). No wonder the problem didn't show up if you don't test on recent versions.

Anyway, I do see that in the Dockerfile, the Python virtual environment is indeed already created with --system-site-packages. I think I'll change the PR to include the flag into the Linux package creation scripts, too, and revert the change in requirements.txt, since installation of dbus-python requires a C compiler and some header files.

@dhs-rec dhs-rec changed the title Fix #7173: Add missing dependency "dbus-python". Fix #7173: Add flag too allow access to system Python packages on recent Linux distributions (-> PEP-668) Jun 5, 2025
@dhs-rec dhs-rec changed the title Fix #7173: Add flag too allow access to system Python packages on recent Linux distributions (-> PEP-668) Fix #7173: Add flag to allow access to system Python packages on recent Linux distributions (-> PEP-668) Jun 5, 2025
@khushboovashi khushboovashi merged commit 44496a3 into pgadmin-org:master Jun 19, 2025
32 checks passed
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

Successfully merging this pull request may close these issues.

Python virtual environment as installed from Debian package lacks dbus-python

2 participants