上下文:Windows10尝试按照说明安装和测试python hid:
pip install hid导入模块的测试失败:
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import hid
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\student\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\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发布的hidapi-win.zip包含预编译的:
hidapi.dll
hidapi.lib问:确定安装这两个文件的正确位置所需的思维过程和事实是什么?假设最近新安装了Windows 10和Python 3.8
发布于 2020-08-16 11:46:34
首先,您需要取消对它们的阻止。右键单击>属性>取消阻止将这两个文件放在python.exe所在的同一文件夹中。可以在命令行中以where python的形式找到python exe的位置
发布于 2020-10-25 03:31:51
将.dll和.lib文件粘贴到WindowsSystem32文件夹中。在重新启动之后,终端和hid模块应该会没有问题地找到该库
https://stackoverflow.com/questions/62620247
复制相似问题