breezy-desktop icon indicating copy to clipboard operation
breezy-desktop copied to clipboard

Desktop installer uses incorrect Python when user's shell is in a virtual environment

Open ikogan opened this issue 9 months ago • 0 comments

When attempting to install the latest version I got the following error:

❯ ./breezy_gnome_setup
Performing setup for GNOME 45 and up (x86_64)
Created temp directory: /tmp/breezy-gnome-dMbJ0Gey0R
Downloading to: /tmp/breezy-gnome-dMbJ0Gey0R/breezyGNOME-x86_64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1376k  100 1376k    0     0  2428k      0 --:--:-- --:--:-- --:--:-- 2428k
Extracting to: /tmp/breezy-gnome-dMbJ0Gey0R/breezy_gnome
ERROR: Python GObject libraries are missing
Please install the required Python GObject dependencies: GTK4, libadwaita, and GStreamer libraries:
If you're using a Python installation from a package manager, you may need to install the following packages:
	For Debian/Ubuntu: sudo apt install python3-gi gir1.2-gtk-4.0 libadwaita-1-0 gir1.2-adw-1 gir1.2-glib-2.0 gir1.2-gobject-2.0 gir1.2-gstreamer-1.0
	For Fedora: sudo dnf install python3-gobject python3-gstreamer1 gtk4 libadwaita
	For Arch Linux: sudo pacman -S python-gobject gst-python gtk4 libadwaita

If you continue to have issues, rerun the setup with BREEZY_IGNORE_PYTHON_ERRORS=1 to skip this check.

Attempting to install those packages showed they were already installed:

❯ sudo apt install python3-gi gir1.2-gtk-4.0 libadwaita-1-0 gir1.2-adw-1 gir1.2-glib-2.0 gir1.2-gobject-2.0 gir1.2-gstreamer-1.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'gir1.2-glib-2.0' instead of 'gir1.2-gobject-2.0'
python3-gi is already the newest version (3.48.2-1).
gir1.2-gtk-4.0 is already the newest version (4.14.2+ds-1ubuntu1).
gir1.2-gtk-4.0 set to manually installed.
libadwaita-1-0 is already the newest version (1.5.0-1ubuntu2).
libadwaita-1-0 set to manually installed.
gir1.2-adw-1 is already the newest version (1.5.0-1ubuntu2).
gir1.2-adw-1 set to manually installed.
gir1.2-glib-2.0 is already the newest version (2.80.0-6ubuntu3.2).
gir1.2-glib-2.0 set to manually installed.
gir1.2-gstreamer-1.0 is already the newest version (1.24.2-1ubuntu0.1).
gir1.2-gstreamer-1.0 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.

I tried doing the import myself using just python3 and reproduced the problem. After some digging, I realized that my default python interpreter is in a virtual environment. The script should not use a configured virtual environment. One way to do this is to do something like

PYTHON_BASE_PREFIX=$(python3 -c "import sys; print(sys.base_prefix)")
"${PYTHON_BASE_PREFIX}"/bin/python3 -c ...

I'm not sure of the ramifications of doing this...it feels like something might break but I'm not sure what.

ikogan avatar Mar 26 '25 20:03 ikogan