0

I receive following error when trying to run pip install pygobject

Collecting pygobject
  Using cached PyGObject-3.42.2.tar.gz (719 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pycairo>=1.16.0
  Using cached pycairo-1.21.0-cp39-cp39-linux_x86_64.whl
Building wheels for collected packages: pygobject
  Building wheel for pygobject (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pygobject (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/pygtkcompat
      copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-cpython-39/pygtkcompat
      copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-cpython-39/pygtkcompat
      copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-cpython-39/pygtkcompat
      creating build/lib.linux-x86_64-cpython-39/gi
      copying gi/types.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/pygtkcompat.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/module.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/importer.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/docstring.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/_signalhelper.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/_propertyhelper.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/_ossighelper.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/_option.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/_gtktemplate.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/_error.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/_constants.py -> build/lib.linux-x86_64-cpython-39/gi
      copying gi/__init__.py -> build/lib.linux-x86_64-cpython-39/gi
      creating build/lib.linux-x86_64-cpython-39/gi/repository
      copying gi/repository/__init__.py -> build/lib.linux-x86_64-cpython-39/gi/repository
      creating build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/__init__.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/Pango.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/Gio.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/GdkPixbuf.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/GObject.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/GLib.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-cpython-39/gi/overrides
      running build_ext
      Package gobject-introspection-1.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'gobject-introspection-1.0', required by 'virtual:world', not found
      Command '('pkg-config', '--print-errors', '--exists', 'gobject-introspection-1.0 >= 1.56.0')' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygobject
Failed to build pygobject
ERROR: Could not build wheels for pygobject, which is required to install pyproject.toml-based projects

I need to install pygobject because it is required for playsound moudule however I do not understand this wheel problem.

There are threads with same problem but with different module. Once of the solution worked was to download wheels for this module but how do I get to that wheel ?

  • have you noted this: `Perhaps you should add the directory containing `gobject-introspection-1.0.pc' to the PKG_CONFIG_PATH environment variable` ? – Rafael Oct 21 '22 at 07:22
  • https://stackoverflow.com/search?q=%5Bpygobject%5D+Package+gobject-introspection+was+not+found+in+the+pkg-config+search+path – phd Oct 21 '22 at 07:25
  • What helped me out is this https://pygobject.readthedocs.io/en/latest/devguide/dev_environ.html?highlight=wheels#arch-dep It gives you commands to build the environment according to operating system. `sudo pacman -S --noconfirm python-wheel` and `sudo pacman -S --noconfirm base-devel openssl zlib git gobject-introspection` resolved my problems – Harsh Prakash Agarwal Oct 21 '22 at 07:32

0 Answers0