1

I want to install PyGObject for installing PyGTK and gstreamer for my project. On the documentation page , two ways are given to install PyGObject, first using pip (using pip install PyGObject in terminal) and second through msys2 both for windows. (https://pygobject.readthedocs.io/en/latest/getting_started.html#windows-logo-windows) I don't know what I am doing wrong but I am getting error every time. The output I am getting with pip :

C:\Users\manik>pip install pygobject
Collecting pygobject
  Using cached PyGObject-3.42.0.tar.gz (716 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.20.1-cp39-cp39-win_amd64.whl (1.2 MB)
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
  ╰─> [9 lines of output]
      running bdist_wheel
      running build
      running build_py
      running build_ext
      pycairo: new API
      pycairo: trying include directory: 'C:\\Users\\manik\\AppData\\Local\\Temp\\pip-build-env-h0530xb7\\overlay\\Lib\\site-packages\\cairo\\include'
      pycairo: found 'C:\\Users\\manik\\AppData\\Local\\Temp\\pip-build-env-h0530xb7\\overlay\\Lib\\site-packages\\cairo\\include\\py3cairo.h'
      building 'gi._gi' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [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

and the error I am getting with msys2:

manik@DESKTOP-T7FEVPK MINGW64 ~
$ pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject
resolving dependencies...
looking for conflicting packages...
warning: dependency cycle detected:
warning: mingw-w64-x86_64-libwebp will be installed before its mingw-w64-x86_64-libtiff dependency
warning: dependency cycle detected:
warning: mingw-w64-x86_64-harfbuzz will be installed before its mingw-w64-x86_64-freetype dependency

Packages (39) mingw-w64-x86_64-adwaita-icon-theme-41.0-1
              mingw-w64-x86_64-atk-2.36.0-2  mingw-w64-x86_64-brotli-1.0.9-4
              mingw-w64-x86_64-cairo-1.17.4-4
              mingw-w64-x86_64-fontconfig-2.13.96-1
              mingw-w64-x86_64-freetype-2.11.1-2
              mingw-w64-x86_64-fribidi-1.0.11-1
              mingw-w64-x86_64-gdk-pixbuf2-2.42.6-2
              mingw-w64-x86_64-giflib-5.2.1-3  mingw-w64-x86_64-glib2-2.70.3-1
              mingw-w64-x86_64-gobject-introspection-runtime-1.70.0-1
              mingw-w64-x86_64-graphite2-1.3.14-2
              mingw-w64-x86_64-gtk-update-icon-cache-3.24.31+76+g3dc44becf0-1
              mingw-w64-x86_64-harfbuzz-3.2.0-1
              mingw-w64-x86_64-hicolor-icon-theme-0.17-2
              mingw-w64-x86_64-jbigkit-2.1-4
              mingw-w64-x86_64-json-glib-1.6.6-2  mingw-w64-x86_64-lerc-3.0-3
              mingw-w64-x86_64-libdatrie-0.2.13-1
              mingw-w64-x86_64-libdeflate-1.8-2
              mingw-w64-x86_64-libepoxy-1.5.9-1
              mingw-w64-x86_64-libjpeg-turbo-2.1.2-2
              mingw-w64-x86_64-libpng-1.6.37-6
              mingw-w64-x86_64-librsvg-2.52.5-2
              mingw-w64-x86_64-libthai-0.1.29-1
              mingw-w64-x86_64-libtiff-4.3.0-7
              mingw-w64-x86_64-libwebp-1.2.2-1
              mingw-w64-x86_64-libxml2-2.9.12-5  mingw-w64-x86_64-lzo2-2.10-2
              mingw-w64-x86_64-pango-1.50.3-1  mingw-w64-x86_64-pcre-8.45-1
              mingw-w64-x86_64-pixman-0.40.0-2
              mingw-w64-x86_64-python-cairo-1.20.1-1
              mingw-w64-x86_64-shared-mime-info-2.1-4
              mingw-w64-x86_64-tzdata-2021e-1
              mingw-w64-x86_64-wineditline-2.205-3
              mingw-w64-x86_64-gtk3-3.24.31+76+g3dc44becf0-1
              mingw-w64-x86_64-python-3.9.10-2
              mingw-w64-x86_64-python-gobject-3.40.1-2

Total Installed Size:  387.96 MiB
Net Upgrade Size:      274.04 MiB

:: Proceed with installation? [Y/n] y
(39/39) checking keys in keyring                   [#####################] 100%
(39/39) checking package integrity                                                                                  [####################################################################] 100%
error: mingw-w64-x86_64-hicolor-icon-theme: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
:: File /var/cache/pacman/pkg/mingw-w64-x86_64-hicolor-icon-theme-0.17-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: mingw-w64-x86_64-graphite2: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
:: File /var/cache/pacman/pkg/mingw-w64-x86_64-graphite2-1.3.14-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: mingw-w64-x86_64-pixman: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
:: File /var/cache/pacman/pkg/mingw-w64-x86_64-pixman-0.40.0-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: mingw-w64-x86_64-atk: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
:: File /var/cache/pacman/pkg/mingw-w64-x86_64-atk-2.36.0-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.
Manu Sm
  • 29
  • 3
  • 1
    This might solve your question https://stackoverflow.com/questions/50784367/how-to-install-python-development-tools-on-msys2 –  Feb 05 '22 at 19:59
  • AFAIK it wasn't possible to install with pip on Windows. That's why the official docs show you the **only** option is to install via MSYS2. If you follow the steps in both the msys2 page (up to step 6) and the ones in the pygobject docs it should work. – Daniel F. Apr 21 '22 at 01:36

0 Answers0