3

I'm packaging an app I wrote in Python 3 which uses:

from gi.repository import AppIndicator3

As I'm listing the dependencies, I have been unable to determine what package contains AppIndicator3. I guessed python-appindicator, but looking at that package it appears that it's for Python 2, not Python 3.

Which package should I depend on?

3

You're importing from gi.repository. The file for this module is:

$ python3 -c 'import gi.repository, sys; print (sys.modules["gi.repository"].__file__)'
/usr/lib/python3/dist-packages/gi/repository/__init__.py

And that file comes from:

$ dpkg -S $(python3 -c 'import gi.repository, sys; print (sys.modules["gi.repository"].__file__)')
python3-gi: /usr/lib/python3/dist-packages/gi/repository/__init__.py

So, the package you need (at least on 14.04) is python3-gi.

| improve this answer | |
2

For my own indicators, I use gir1.2-appindicator3-0.1 as dependency. If I recall correctly libappindicator3-dev is for development. Either one works in my experience.

| improve this answer | |
1

I followed the procedure described in muru's answer on Ubuntu 18.04 with GNOME desktop, and got precisely the same output as muru reports for Ubuntu 14.04:

python3-gi: /usr/lib/python3/dist-packages/gi/repository/__init__.py  

However, in order to run a script containing the line

from gi.repository import AppIndicator3

I had to install not only python3-gi but also libappindicator3-dev:

sudo apt install libappindicator3-dev
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.