'Python3 AttributeError: module 'signal' has no attribute 'getsignal'

Trying to import matplotlib for Python 3.8.2 with from matplotlib import pyplot as plt

I am using matplotlib version 3.2.2

Traceback (most recent call last):
  File "data.py", line 4, in <module>
    from matplotlib import pyplot as plt
  File "/home/andrew/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2282, in <module>
    switch_backend(rcParams["backend"])
  File "/home/andrew/.local/lib/python3.8/site-packages/matplotlib/__init__.py", line 832, in __getitem__
    plt.switch_backend(rcsetup._auto_backend_sentinel)
  File "/home/andrew/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 204, in switch_backend
    switch_backend(candidate)
  File "/home/andrew/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 221, in switch_backend
    backend_mod = importlib.import_module(backend_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/andrew/.local/lib/python3.8/site-packages/matplotlib/backends/backend_gtk3agg.py", line 8, in <module>
    from . import backend_agg, backend_gtk3
  File "/home/andrew/.local/lib/python3.8/site-packages/matplotlib/backends/backend_gtk3.py", line 31, in <module>
    from gi.repository import GLib, GObject, Gtk, Gdk
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 146, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/usr/lib/python3/dist-packages/gi/overrides/__init__.py", line 118, in load_overrides
    override_mod = importlib.import_module(override_package_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/lib/python3/dist-packages/gi/overrides/GLib.py", line 26, in <module>
    from .._ossighelper import wakeup_on_signal, register_sigint_fallback
  File "/usr/lib/python3/dist-packages/gi/_ossighelper.py", line 147, in <module>
    if signal.getsignal(signal.SIGINT) is signal.default_int_handler:
AttributeError: module 'signal' has no attribute 'getsignal'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source