Trouble installing Tryton dependencies (PyGObject, girepository-2.0) on WSL2 Ubuntu

Hello community,

I’m encountering persistent issues while trying to install the development dependencies for Tryton on my Windows Subsystem for Linux 2 (WSL2) running Ubuntu.

I’ve followed the standard Tryton installation instructions, but I’m consistently running into problems specifically with PyGObject. The error I receive during pip install -e ... is:

`error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.`

Looking at the detailed output, the underlying error seems to be that meson cannot find the dependency girepository-2.0. The relevant part of the error message is:

../meson.build:31:9: ERROR: Dependency 'girepository-2.0' is required but not found.

Here’s a summary of the steps I’ve taken so far to try and resolve this:

  • Installed build essentials and Python development headers: sudo apt install build-essential python3-dev
  • Installed libgirepository1.0-dev: sudo apt install libgirepository1.0-dev
  • Tried installing pycairo separately (another dependency that often has similar build issues): pip install pycairo (failed with “Unknown compiler(s)” initially, then progressed to similar girepository-2.0 not found error after installing build tools).
  • Verified pkg-config is installed: pkg-config --version returns 1.8.1.
  • Checked pkg-config paths: pkg-config --variable pc_path pkg-config returns /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig . 1

[

  1. github.com
    ](Vagrant fails to call VBoxManage · Issue #12088 · hashicorp/vagrant · GitHub)


github.com

  • Tried to find girepository-*.pc files: sudo find / -name "*girepository*.pc" returned no results.
  • Reinstalled gobject-introspection and related packages: sudo apt remove --purge ..., sudo apt update, sudo apt install ...
  • Tried installing python3-gi using apt: sudo apt install python3-gi (reports as already installed, but import gi fails in the virtual environment).
  • Tried installing PyGObject with pip within the virtual environment.

Despite these steps, the issue persists. It seems the .pc file for girepository-2.0 is either missing or not in a location where meson can find it within the WSL2 environment.

Has anyone else encountered this issue on WSL2? Any suggestions on how to resolve the girepository-2.0 dependency not being found for PyGObject installation? Any insights into where the .pc file might be located or how to make it visible to the build process would be greatly appreciated.

Thank you for your time and help!

Sincerely,

I had a similar problem with Ubuntu 24.04, my solution was that I had to reinstall the virtual environment and create a new virtual environment.
Apparently there was a problem with the virtual environment I was using which was causing a conflict with the Python version, and making it impossible to install this particular dependency.

1 Like

Tryton consists of three parts:

  1. PostgreSQL database server
  2. Trytond server
  3. Tryton client

Looking at the errors, it seems you are trying to install the Tryton client. Only if you want make changes to the client, you need to install the sources. Otherwise I will suggest to just download the desktop client from Tryton - Get Tryton and install it.

1 Like