AttributeError: module 'socket' has no attribute 'socketpair'
my python source program = hello.py contains following lines :
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()
i have following problem when i run this python program : python3.9 hello.py
Traceback (most recent call last):
File "/data/py/hello.py", line 8, in <module>
Gtk.main()
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1648, in main
with wakeup_on_signal():
File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/lib/python3/dist-packages/gi/_ossighelper.py", line 76, in wakeup_on_signal
read_socket, write_socket = socket.socketpair()
AttributeError: module 'socket' has no attribute 'socketpair'
Any idea how to solve this problem ?
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.10.0-8-amd64
Architecture: x86-64
Edited by Marinus Schraal