【问题标题】:How to Determine where to install hidapi.dll?如何确定 hidapi.dll 的安装位置?
【发布时间】:2020-10-18 13:27:48
【问题描述】:

上下文:Windows 10 尝试按照说明安装和测试 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

【问题讨论】:

  • 这个运气好吗?我也有同样的问题。

标签: python-3.x windows hid


【解决方案1】:

首先,您需要取消阻止它们。右键单击>属性>取消阻止 将这两个文件放在python.exe 所在的同一文件夹中。 python exe的位置可以在命令行中找到where python

【讨论】:

  • 感谢您的回复:请提供任何示例或相关参考资料的链接。
【解决方案2】:

将 .dll 和 .lib 文件粘贴到 Windows/System32 文件夹中。之后重新启动终端,hid 模块应该没有问题地找到库

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-12-31
    • 2018-07-14
    • 1970-01-01
    • 2017-06-19
    • 2013-09-25
    • 2014-07-26
    • 1970-01-01
    • 2014-02-19
    相关资源
    最近更新 更多