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

packages/pip + py import error #55

Closed
JonnesCranach opened this issue Mar 7, 2023 · 4 comments
Closed

packages/pip + py import error #55

JonnesCranach opened this issue Mar 7, 2023 · 4 comments

Comments

@JonnesCranach
Copy link

JonnesCranach commented Mar 7, 2023

Hi,

great project, I need to have a deeper look into it when I have time.
pip is running into errors installing cairo, so I installed it via apt.

python3-cairo python3-cairo-dev libcairo2-dev libgirepository1.0-dev
(after removing them again pip build was successfully) ... weird

starting remapper.py or also web.py is resulting in

remapper.py

Traceback (most recent call last):
  File "/home/pi/bthidhub/remapper.py", line 10, in <module>
    from adapter import BluetoothAdapter
  File "/home/pi/bthidhub/adapter.py", line 7, in <module>
    from hid_devices import *
  File "/home/pi/bthidhub/hid_devices.py", line 16, in <module>
    from compatibility_device import CompatibilityModeDevice
  File "/home/pi/bthidhub/compatibility_device.py", line 2, in <module>
    from hidtools.uhid import UHIDDevice
  File "/usr/local/lib/python3.9/dist-packages/hidtools/uhid.py", line 21, in <module>
    import hidtools.hid
  File "/usr/local/lib/python3.9/dist-packages/hidtools/hid.py", line 26, in <module>
    from hidtools.hut import HUT, U8, U16, U32
  File "/usr/local/lib/python3.9/dist-packages/hidtools/hut.py", line 27, in <module>
    from typing import (
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib/python3.9/typing.py)

web.py

Traceback (most recent call last):
  File "/home/pi/bthidhub/web.py", line 6, in <module>
    from hid_devices import *
  File "/home/pi/bthidhub/hid_devices.py", line 16, in <module>
    from compatibility_device import CompatibilityModeDevice
  File "/home/pi/bthidhub/compatibility_device.py", line 2, in <module>
    from hidtools.uhid import UHIDDevice
  File "/usr/local/lib/python3.9/dist-packages/hidtools/uhid.py", line 21, in <module>
    import hidtools.hid
  File "/usr/local/lib/python3.9/dist-packages/hidtools/hid.py", line 26, in <module>
    from hidtools.hut import HUT, U8, U16, U32
  File "/usr/local/lib/python3.9/dist-packages/hidtools/hut.py", line 27, in <module>
    from typing import (
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib/python3.9/typing.py)

Thanks for help or hints

@JonnesCranach JonnesCranach changed the title Packages missing + py import error packages/pip + py import error Mar 7, 2023
@Dreamsorcerer
Copy link
Collaborator

File a bug report against hidtools. They've release a package that claims to support Python 3.6+, yet tries to import things that only exist in Python 3.10+.

@Dreamsorcerer Dreamsorcerer closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
@JonnesCranach
Copy link
Author

using 3.1+ helps?

@Dreamsorcerer
Copy link
Collaborator

hidtools==0.3.1? It was released only a little earlier, so may or may not have the same issue. I guess 0.2 is the version we were using when testing, but getting hidtools to fix their testing/packaging would avoid us needing to pin to a specific release.

@lswee
Copy link

lswee commented Aug 4, 2023

Can confirm that changing the line:

sudo pip3 install hid-tools

To:
sudo pip3 install hid-tools==0.2

Fixes the error.

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

No branches or pull requests

3 participants