Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError with ykman 5.0.0 #328

Open
AidanGG opened this issue Oct 28, 2022 · 11 comments
Open

ImportError with ykman 5.0.0 #328

AidanGG opened this issue Oct 28, 2022 · 11 comments

Comments

@AidanGG
Copy link

AidanGG commented Oct 28, 2022

  • YubiKey Manager version: 5.0.0
  • How was it installed?: pacman, Arch Linux [community] repo
  • Operating system and version: Arch Linux
  • YubiKey model and version: YubiKey 5 NFC (5.2.7)
  • Bug description summary: does not detect YubiKey under ykman 5.0.0

Steps to reproduce

Install ykman 5.0.0, then run ykman-gui --log-level DEBUG.
Receive error:
ImportError: cannot import name 'connect_to_device' from 'ykman' (/usr/lib/python3.10/site-packages/ykman/__init__.py)

The GUI does appear, but no YubiKeys are detected.

Expected result

The YubiKeys are detected, and the manager functions as normal.

Additional Info

Works with ykman 4.0.9, the version prior to the update to 5.0.0 on Arch Linux.

@dainnilsson
Copy link
Member

The ykman CLI project uses semantic versioning, and the major number increase from 4 to 5 signals backwards incompatible changes. yubikey-manager-qt requires ykman 4.x. and any packaging of the yubikey-manager-qt needs to ensure this.

@gbcox
Copy link

gbcox commented Oct 29, 2022

Any idea when this will be upgraded for ykman 5. This will be another blocker for Fedora.

@IPlayZed
Copy link

IPlayZed commented Oct 29, 2022

Hi, I can confirm that on Arch the Qt apps are broken.

My relevant logs are:

Oct 29 18:18:08 archpc yubioath-desktop[5437]: "PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc:///py/yubikey.py\", line 23, in <module>\n    from ykman.device import scan_devices, list_all_devices, connect_to_device, get_name, read_info\n\nImportError: cannot import name 'connect_to_device' from 'ykman.device' (/usr/lib/python3.10/site-packages/ykman/device.py)\n"
Oct 29 18:18:08 archpc yubioath-desktop[5437]: Unhandled PyOtherSide error: Cannot import module: yubikey (Traceback (most recent call last):
                                               
                                                 File "qrc:///py/yubikey.py", line 23, in <module>
                                                   from ykman.device import scan_devices, list_all_devices, connect_to_device, get_name, read_info
                                               
                                               ImportError: cannot import name 'connect_to_device' from 'ykman.device' (/usr/lib/python3.10/site-packages/ykman/device.py)
                                               )
Oct 29 18:18:08 archpc yubioath-desktop[5437]: "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'yubikey' is not defined\n"
Oct 29 18:18:08 archpc yubioath-desktop[5437]: Unhandled PyOtherSide error: Function not found: 'yubikey.init' (Traceback (most recent call last):
                                               
                                                 File "<string>", line 1, in <module>
                                               
                                               NameError: name 'yubikey' is not defined
                                               )
Oct 29 18:18:08 archpc yubioath-desktop[5437]: "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'yubikey' is not defined\n"
Oct 29 18:18:08 archpc yubioath-desktop[5437]: Unhandled PyOtherSide error: Function not found: 'yubikey.controller.check_descriptors' (Traceback (most recent call last):
                                               
                                                 File "<string>", line 1, in <module>
                                               
                                               NameError: name 'yubikey' is not defined
                                               )
Oct 29 18:18:08 archpc yubioath-desktop[5437]: qml: TypeError: Cannot read property 'success' of undefined undefined
Oct 29 18:18:08 archpc yubioath-desktop[5437]: "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'yubikey' is not defined\n"
Oct 29 18:18:08 archpc yubioath-desktop[5437]: Unhandled PyOtherSide error: Function not found: 'yubikey.controller.is_win_non_admin' (Traceback (most recent call last):
                                               
                                                 File "<string>", line 1, in <module>
                                               
                                               NameError: name 'yubikey' is not defined
                                               )

This breaks yubikey-manager as well. It seems like the core problem is that the correct Python module can not be imported: Unhandled PyOtherSide error: Cannot import module: yubikey
My relevant package versions are:

yubico-c 1.13-6
yubico-c-client 2.15-5
yubico-pam 2.27-2
yubikey-full-disk-encryption r150.2c5fdf3-1
yubikey-manager 5.0.0-1
yubikey-manager-qt 1.2.4-1
yubikey-personalization 1.20.0-3
yubikey-personalization-gui 3.1.25-2
python 3.10.8-2

@IPlayZed
Copy link

Seems to be the same thing as #320 .

@AidanGG
Copy link
Author

AidanGG commented Oct 30, 2022

#320 occurs from misconfiguration of the Python environment, this issue occurs because of the incompatibility with the newly released ykman 5.

@dainnilsson
Copy link
Member

Any idea when this will be upgraded for ykman 5. This will be another blocker for Fedora.

Unfortunately I don't have a date for that, nothing scheduled right now. If I were to make a guess I'd say sometime in Q1 of next year, but don't hold me to that!

@vbrandl
Copy link

vbrandl commented Nov 12, 2022

While it doesn't solve the actual problem, creating a python virtual environment, installing yubikey-manager 4 and starting ykman-gui inside that environment, works for now:

python -m venv .venv
source .venv/bin/activate
pip install yubikey-manager==4.0.9

For now I use the following script inside the venv to start ykman-gui:

#!/usr/bin/bash

source .venv/bin/activate
ykman-gui
deactivate

@vbrandl
Copy link

vbrandl commented Nov 14, 2022

Looking at https://github.com/archlinux/svntogit-community/commits/packages/yubikey-manager/trunk, Arch Linux downgraded the yubikey-manager package back to 4.0.9. This should fix the problem for Arch based distros for now.

@fdennis
Copy link
Contributor

fdennis commented Feb 3, 2023

Hello,
1.2.5 has just been released and is compatible with ykman 5.0.1.

@IPlayZed
Copy link

This issue should be closed as far as I understand.

@mordax7
Copy link

mordax7 commented Sep 3, 2024

I still have the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants