adfinis / timedctl

GNU Affero General Public License v3.0
5 stars 0 forks source link

Cannot import name 'properties' from 'keyring.util' #44

Closed in0rdr closed 5 months ago

in0rdr commented 1 year ago

I was trying to install the timedctl and encountered the following issue:

$ timedctl 
Error initializing plugin EntryPoint(name='Keyutils/KernelKeyring', value='keyutils.backend:KeyutilsKeyringBackend', group='keyring.backends').
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/keyring/backend.py", line 208, in _load_plugins
    init_func = ep.load()
                ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/importlib_metadata/__init__.py", line 209, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib64/python3.11/site-packages/keyutils/backend.py", line 6, in <module>
    from keyring.util import properties
ImportError: cannot import name 'properties' from 'keyring.util' (/usr/lib/python3.11/site-packages/keyring/util/__init__.py)
Error initializing plugin EntryPoint(name='Keyutils/OscKernelKeyring', value='keyutils.osc:OscKernelKeyringBackend', group='keyring.backends').
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/keyring/backend.py", line 208, in _load_plugins
    init_func = ep.load()
                ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/importlib_metadata/__init__.py", line 209, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib64/python3.11/site-packages/keyutils/osc.py", line 16, in <module>
    from keyutils.backend import KeyutilsKeyringBackend
  File "/usr/lib64/python3.11/site-packages/keyutils/backend.py", line 6, in <module>
    from keyring.util import properties
ImportError: cannot import name 'properties' from 'keyring.util' (/usr/lib/python3.11/site-packages/keyring/util/__init__.py)
Usage: timedctl [OPTIONS] COMMAND [ARGS]...

  Use timedctl.

Options:
  --help  Show this message and exit.

Commands:
  activity (ac)             Do stuff with activities.
  add (a,create)            Add different things.
  delete (d,del,remove,rm)  Delete different things.
  edit (e,edit,update)      Edit different things.
  get (describe,g,show)     Get different things.

OS: openSUSE Tumbleweed (with gnome-keyring)

python3 --version
Python 3.11.4

Installation method:

pip install -U timedctl

With Poetry, there are similar issues during installation:

$ poetry install
Creating virtualenv timedctl-dThWel0q-py3.11 in /home/andi/.cache/pypoetry/virtualenvs
Installing dependencies from lock file

Package operations: 47 installs, 0 updates, 0 removals

  • Installing pycparser (2.21): Pending...
Error initializing plugin EntryPoint(name='Keyutils/KernelKeyring', value='keyutils.backend:KeyutilsKeyringBackend', group='keyring.backends').
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/keyring/backend.py", line 208, in _load_plugins
    init_func = ep.load()
                ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/importlib_metadata/__init__.py", line 209, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib64/python3.11/site-packages/keyutils/backend.py", line 6, in <module>
    from keyring.util import properties
ImportError: cannot import name 'properties' from 'keyring.util' (/usr/lib/python3.11/site-packages/keyring/util/__init__.py)
Error initializing plugin EntryPoint(name='Keyutils/OscKernelKeyring', value='keyutils.osc:OscKernelKeyringBackend', group='keyring.backends').
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/keyring/backend.py", line 208, in _load_plugins
    init_func = ep.load()
                ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/importlib_metadata/__init__.py", line 209, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib64/python3.11/site-packages/keyutils/osc.py", line 16, in <module>
    from keyutils.backend import KeyutilsKeyringBackend
  File "/usr/lib64/python3.11/site-packages/keyutils/backend.py", line 6, in <module>
    from keyring.util import properties
ImportError: cannot import name 'properties' from 'keyring.util' (/usr/lib/python3.11/site-packages/keyri  • Installing pycparser (2.21)

However, I can successfully run the output of the build process:

poetry run timedctl
Usage: timedctl [OPTIONS] COMMAND [ARGS]...

  Use timedctl.

Options:
  --help  Show this message and exit.

Commands:
  activity (ac)             Do stuff with activities.
  add (a,create)            Add different things.
  delete (d,del,remove,rm)  Delete different things.
  edit (e,edit,update)      Edit different things.
  get (describe,g,show)     Get different things.
gianklug commented 1 year ago

Can you drop your OS Version and the version of the failing packages here so I can try to reproduce it?

in0rdr commented 1 year ago

I can use the CLI now for my purposes with:

alias timedctl="timedctl 2> /dev/null"

So it kind of works fine (functionality not impacted) but I just hide all the error messages :)

in0rdr commented 1 year ago

My OS :lizard: :

cat /etc/*release
NAME="openSUSE Tumbleweed"
# VERSION="20230718"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20230718"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20230718"
BUG_REPORT_URL="https://bugzilla.opensuse.org"
SUPPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
LOGO="distributor-logo-Tumbleweed"

My python :snake: user packages:

ls -l ~/.local/lib/python3.11/site-packages/ | awk '{print $9}'
cattr
cattrs
cattrs-23.1.2.dist-info
click_aliases
click_aliases-1.0.1.dist-info
_distutils_hack
distutils-precedence.pth
inflection
inflection-0.5.1.dist-info
inflection.py
libtimed
libtimed-0.4.4.dist-info
markdown_it
markdown_it_py-3.0.0.dist-info
mdurl
mdurl-0.1.2.dist-info
msgpack
msgpack-1.0.5.dist-info
pip
pip-23.2.dist-info
pkgconfig
pkgconfig-1.5.5.dist-info
pkg_resources
platformdirs
platformdirs-3.10.0.dist-info
__pycache__
pyfzf
pyfzf-0.3.1.dist-info
pygments
Pygments-2.16.1.dist-info
requests_cache
requests_cache-1.1.0.dist-info
rich
rich-13.5.2.dist-info
setuptools
setuptools-68.0.0.dist-info
terminaltables
terminaltables-3.1.10.dist-info
timedctl
timedctl-5.3.1.dist-info
tomlkit
tomlkit-0.12.1.dist-info
url_normalize
url_normalize-1.4.3.dist-info
wheel
wheel-0.40.0.dist-info
in0rdr commented 1 year ago

It's the same behavior when I remove gnome-keyring completely. So I can use the CLI, it works fine, even without gnome-keyring :man_shrugging: