-
Notifications
You must be signed in to change notification settings - Fork 3
ImportError after Pip update to v0.8.0 #19
Comments
So this is a replay of the previous issue (#17) but now the players are hidapi and Cython rather than my buggy HID wrapper and ctypes. Cython uses a hybrid language that's a combination of Python and C to wrap shared objects and I will have to do some research to find out how it locates shared libraries. I'll update as soon as I have a better idea of how Cython works. |
I did some reading (docs and code) and have improved my understanding of Cython projects and packaging. It appears that cython-hidapi does not need a separate shared object installed to function. I tested this by removing hidapi and installing blycnlight in a virtual environment:
To be honest this is a tidier solution than my previous implementation, so I really hope we can get this working for you. |
I'm curious what the output of In the venv created above, I got this output: $ pip list
Package Version
---------- -----------
blynclight 0.8.0
certifi 2020.6.20
chardet 3.0.4
click 7.1.2
hidapi 0.9.0.post3
idna 2.9
pip 20.1.1
requests 2.24.0
setuptools 47.3.1
typer 0.2.1
urllib3 1.25.9 |
Embarrassingly, the 0.8.0 release was built from a feature branch (hid) and not master which may or may not have been completely up-to-date. I've reconciled the two branches and pushed a new release 0.8.2 to PyPI. |
I got both the
There is a conflict between the two "busy light" modules I'm currently using when it comes to
I made no other changes to the compiled libraries installed in my Meanwhile, my errors were in a different
|
I think I see a problem in the I can relax the version requirements for hidapi in the packaging for blynclight to see if that helps improve your situation. |
Yep, I've recreated the error that started this issue. I don't have libhidapi.dyld installed by either ports or brew: $ pip list
Package Version
---------- ---------
certifi 2020.6.20
chardet 3.0.4
click 7.1.2
hid 1.0.4
idna 2.9
pip 20.1.1
requests 2.24.0
setuptools 47.3.1
typer 0.2.1
urllib3 1.25.9
$ python3 -c "import hid"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/ejo/tmp/venv/.venv/lib/python3.7/site-packages/hid/__init__.py", line 30, in <module>
raise ImportError(error)
ImportError: Unable to load any of the following libraries:libhidapi-hidraw.so libhidapi-hidraw.so.0 libhidapi-libusb.so libhidapi-libusb.so.0 libhidapi-iohidmanager.so libhidapi-iohidmanager.so.0 libhidapi.dylib hidapi.dll libhidapi-0.dll It is my opinion that the Cython hidapi solution is superior by nearly every measure I can think of:
If you like, I can take a look at the luxafaret code to see about porting to Cython hidapi ( should be trivial ). |
So I took a look at the Luxafaret project and it seems a little abandoned. I've ordered a LuxaFor flag and it should be here Thursday :) I'll add support to blynclight for the Flag and that will solve having to get our two projects synced enough to not interfere with each other. |
@Jaharmi I've got a new project you might be interested in, busylight-for-humans. It supports both Embrava BlyncLights and Luxafor Flags from the same command-line: $ busylight list
...
$ busylight supported
Embrava BlyncLight
Luxafor Flag
$ busylight on
$ busylight blink
$ busylight off This should help you work with your lights while not having to fight dependencies. Let me know how it works for you. |
I updated my virtualenv that includes
blynclight
to v0.8.0 using Pip. Afterwards, I get an import error both inptpython
and the same thing when using the CLI tool.I'm looking into what's going on.
My update went from:
The text was updated successfully, but these errors were encountered: