[Bug 1903027] [NEW] Regression: Unable to run PyGObject using a Virtual Environment after updating to 20.10
Roberto Leinardi
1903027 at bugs.launchpad.net
Thu Nov 5 10:05:15 UTC 2020
Public bug reported:
After updating from Ubuntu 20.04 to Ubuntu 20.10 I am not able to run
PyGObject applications on a Python Virtual Environment.
I can reproduce the issue following these simple steps:
sudo apt-get install python3-venv
python3 -m venv venv
source env/bin/activate
pip install PyGObject==3.38.0
python3 hw.py
Where hw.py is the standard PyGObject Hello World:
#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
window = Gtk.Window(title="Hello World")
window.show()
window.connect("destroy", Gtk.main_quit)
Gtk.main()
When I try to run it, it throws this error:
$ python3 hw.py
Traceback (most recent call last):
File "hw.py", line 3, in <module>
import gi
File "/home/leinardi/temp/hw/venv/lib/python3.8/site-packages/gi/__init__.py", line 40, in <module>
from . import _gi
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
Running hw.py on the System Environment of 20.10 works correctly (the issue only happens when using the Virtual Environment).
A workaround is to find and provide a copy of libffi.so.7 in
/usr/lib/x86_64-linux-gnu/ but, since this library version is not
available inside the official repositories of Ubuntu 20.10, this is a
difficult and unsafe operation.
ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: python3-venv 3.8.6-0ubuntu1
ProcVersionSignature: Ubuntu 5.8.0-26.27-generic 5.8.14
Uname: Linux 5.8.0-26-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu50
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Thu Nov 5 10:57:41 2020
InstallationDate: Installed on 2019-09-27 (404 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Alpha amd64 (20190923)
SourcePackage: python3-defaults
UpgradeStatus: Upgraded to groovy on 2020-11-04 (0 days ago)
** Affects: python3-defaults (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug groovy
** Attachment added: "hw.py"
https://bugs.launchpad.net/bugs/1903027/+attachment/5431506/+files/hw.py
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1903027
Title:
Regression: Unable to run PyGObject using a Virtual Environment after
updating to 20.10
Status in python3-defaults package in Ubuntu:
New
Bug description:
After updating from Ubuntu 20.04 to Ubuntu 20.10 I am not able to run
PyGObject applications on a Python Virtual Environment.
I can reproduce the issue following these simple steps:
sudo apt-get install python3-venv
python3 -m venv venv
source env/bin/activate
pip install PyGObject==3.38.0
python3 hw.py
Where hw.py is the standard PyGObject Hello World:
#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
window = Gtk.Window(title="Hello World")
window.show()
window.connect("destroy", Gtk.main_quit)
Gtk.main()
When I try to run it, it throws this error:
$ python3 hw.py
Traceback (most recent call last):
File "hw.py", line 3, in <module>
import gi
File "/home/leinardi/temp/hw/venv/lib/python3.8/site-packages/gi/__init__.py", line 40, in <module>
from . import _gi
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
Running hw.py on the System Environment of 20.10 works correctly (the issue only happens when using the Virtual Environment).
A workaround is to find and provide a copy of libffi.so.7 in
/usr/lib/x86_64-linux-gnu/ but, since this library version is not
available inside the official repositories of Ubuntu 20.10, this is a
difficult and unsafe operation.
ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: python3-venv 3.8.6-0ubuntu1
ProcVersionSignature: Ubuntu 5.8.0-26.27-generic 5.8.14
Uname: Linux 5.8.0-26-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu50
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Thu Nov 5 10:57:41 2020
InstallationDate: Installed on 2019-09-27 (404 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Alpha amd64 (20190923)
SourcePackage: python3-defaults
UpgradeStatus: Upgraded to groovy on 2020-11-04 (0 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1903027/+subscriptions
More information about the foundations-bugs
mailing list