Issues with Python gi package on Ubuntu

Hello not sure it’s the right place but…
I’m using a package that uses gi and I’m getting the following error

Require a package "gir1.2-secret-1" which could be installed by:
    sudo apt install gir1.2-secret-1

Traceback (most recent call last):
File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/msal_extensions/libsecret.py”, line 34, in
gi.require_version(“Secret”, “1”) # Would require a package gir1.2-secret-1
File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/gi/init.py”, line 126, in require_version
raise ValueError(‘Namespace %s not available’ % namespace)
ValueError: Namespace Secret not available
Using Vault URI

I followed the install instructions in and when I check for gir1.2-secret-1 I see it is installed.

apt list | grep gir1.2-secret-1

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gir1.2-secret-1/bionic,now 0.18.6-1 amd64 [installed]

I tried running a small python script to see what is the output of gi.require_version(“Secret”, “1”) and I’m getting the following output

import gi
gi.require_version("Secret", "1")
from gi.repository import Secret

print(gi.require_version("Secret", "1"))

the output is None

when I run python "import gi; print(gi.__file__)" I get
python: can't open file 'import gi; print(gi.__file__)': [Errno 2] No such file or directory

and running apt policy python-gi gives the following

python-gi:
  Installed: 3.26.1-2ubuntu1
  Candidate: 3.26.1-2ubuntu1
  Version table:
 *** 3.26.1-2ubuntu1 500
        500 http://azure.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.26.1-2 500
        500 http://azure.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

I understand that python "import gi; print(gi.file) should return something in /usr/lib/ or something.
I’m kinda lost here, any assistance would be appreciated. I’m running Linux compnode03 5.4.0-1056-azure #58~18.04.1-Ubuntu SMP Wed Jul 28 23:14:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

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