# Tryton requires pygtkcompat, but OS doesn't provide it

**URL:** <https://discuss.tryton.org/t/tryton-requires-pygtkcompat-but-os-doesnt-provide-it/4726>\
**Category:** User\
**Created:** [October 25, 2021, 3:55pm UTC](https://discuss.tryton.org/t/tryton-requires-pygtkcompat-but-os-doesnt-provide-it/4726 "2021-10-25T15:55:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmorato](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/fmorato/32/109_2.png) [@fmorato](https://discuss.tryton.org/u/fmorato)\
**Post date:** [October 25, 2021, 3:55pm UTC](https://discuss.tryton.org/t/tryton-requires-pygtkcompat-but-os-doesnt-provide-it/4726/1 "2021-10-25T15:55:27Z")

</div>

I just tried the following on OpenSuse Tumbleweed with Gnome, and it doesn’t seem to have `pygtkcompat`.

```bash
$ pip install --user tryton
Collecting tryton
  Downloading tryton-6.0.8-py3-none-any.whl (596 kB)
     |████████████████████████████████| 596 kB 636 kB/s 
Requirement already satisfied: python-dateutil in /usr/lib/python3.8/site-packages (from tryton) (2.8.2)
Requirement already satisfied: PyGObject in /usr/lib64/python3.8/site-packages (from tryton) (3.42.0)
Requirement already satisfied: pycairo in /usr/lib64/python3.8/site-packages (from tryton) (1.20.1)
Requirement already satisfied: six>=1.5 in /usr/lib/python3.8/site-packages (from python-dateutil->tryton) (1.16.0)
Installing collected packages: tryton
Successfully installed tryton-6.0.8

$ .local/bin/tryton

```

Tryton starts, but upon login in, I still get:

```auto
ModuleNotFoundError: No module named 'pygtkcompat'

```

According to [Files · main · GNOME / pygobject · GitLab](https://gitlab.gnome.org/GNOME/pygobject/blob/master/setup.py#L1233), it is still included in pygobject.

I did read through the other threads on the `pygtkcompat`, but regardless of maintainability, being supported or not, I can’t run Tryton either from source or by installing with pip.

> [@Tryton 6.0 client requires pygtkcompat](https://discuss.tryton.org/t/tryton-6-0-client-requires-pygtkcompat/4161):
>
> I have installed Tryton 6.0 client via pip3 on a fresh Tumbleweed system and MATE desktop, Python 3.8.8 When attempting to connect to the demo server it crashes with: ModuleNotFoundError: No module named ‘pygtkcompat’ As this was an issue for Tryton 5.0 ([https://discuss.tryton.org/t/why-does-tryton-still-needs-pygtkcompat-library/1608/13](https://discuss.tryton.org/t/why-does-tryton-still-needs-pygtkcompat-library/1608/13)), I seem to remember that full Python3/GTK3 compatibility was planned for Tryton 5.2?

> [@Why does Tryton still needs pygtkcompat library?](https://discuss.tryton.org/t/why-does-tryton-still-needs-pygtkcompat-library/1608):
>
> Stumbled over this while compiling Tryton 5 client. According to [https://bugs.tryton.org/msg47158](https://bugs.tryton.org/msg47158) it should have been removed, as this seems to be not needed/not supported anymore in python-gobject.

What is the solution?

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [October 25, 2021, 4:07pm UTC](https://discuss.tryton.org/t/tryton-requires-pygtkcompat-but-os-doesnt-provide-it/4726/2 "2021-10-25T16:07:25Z")

</div>

First you should complaint to OpenSUSE to explicitly remove some standard features of a package (which is not only for backward compatibility).  
Now `tryton` needs only `pygtkcompat.generictreemodel` (in `tryton/gui/window/view_form/view/list.py`).  
So you could copy the `generictreemodel.py` in this folder and replace the line:

```auto
from pygtkcompat.generictreemodel import GenericTreeModel

```

by

```auto
from .generictreemodel import GenericTreeModel

```

---

<div class="post-metadata">

**Author:** ![coogor](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/coogor/32/47_2.png) [@coogor](https://discuss.tryton.org/u/coogor)\
**Post date:** [October 25, 2021, 4:14pm UTC](https://discuss.tryton.org/t/tryton-requires-pygtkcompat-but-os-doesnt-provide-it/4726/3 "2021-10-25T16:14:35Z")

</div>

> [@ced](#):
>
> First you should complaint to OpenSUSE to explicitly remove some standard features of a package (which is not only for backward compatibility).

..or just review the prior discussions on that, this should answer it.

@fmorato - why dont you just use the tryton-packages in Application:ERP:Tryton:6.0 ?  
(OK, I have not announced its availability…but from the link on [tryton.org](http://tryton.org) one should get there)

---

<div class="post-metadata">

**Author:** ![fmorato](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/fmorato/32/109_2.png) [@fmorato](https://discuss.tryton.org/u/fmorato)\
**Post date:** [October 25, 2021, 5:38pm UTC](https://discuss.tryton.org/t/tryton-requires-pygtkcompat-but-os-doesnt-provide-it/4726/4 "2021-10-25T17:38:44Z")

</div>

Thanks for both answers. I can see from the [OpenSuse Tryton repo](https://build.opensuse.org/project/subprojects/Application:ERP:Tryton) that they are [manually adding `generictreemodel` to the Tryton package](https://build.opensuse.org/package/view_file/Application:ERP:Tryton:6.0/tryton/000-pygtkcompat.diff?expand=1).

Adding the repo for Tryton 6.0 and installing the Tryton package.

```sh
# zypper ar -f https://download.opensuse.org/repositories/Application:/ERP:/Tryton:/6.0/openSUSE_Tumbleweed Tryton
# zypper in tryton

```

It’s nice to have it installed as a system package ^^

On a side note, I guess reading the threads and no mention of the repo, I totally forgot about the repository links on the website.

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [November 24, 2021, 5:38pm UTC](https://discuss.tryton.org/t/tryton-requires-pygtkcompat-but-os-doesnt-provide-it/4726/5 "2021-11-24T17:38:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
