pyusb 无法安装
我正在尝试设置一些 python 脚本来控制低级 USB 功能。为了做到这一点,我发现需要安装两个库:libusb 和 pyusb。我首先安装了 libusb 并且成功了,但现在 pyusb (版本 1.0.0)遇到了问题。
我尝试使用推荐的命令(在 pyusb 文件夹中)安装 pyusb: python setup.py install
从运行此命令后的输出来看,它看起来已经安装没有问题。但是当我尝试运行我的简单程序时,它给出了一个错误:
File "/Users/michael/Desktop/usb.py", line 1, in import usb.core ImportError: No module named core
My python script tries to import usb.core, so if there's no module, then pyusb didn't install.
Other people have had the same problem. Their approach was to uninstall the old versions of pyusb, but to my knowledge, I have no previous installations.
如何安装 pyusb 库?
提前致谢。我非常感谢您的帮助。
--米
I'm trying to setup some python scripts for controlling low-level USB functions. In order to do this, I've found that two libraries need to be installed: libusb and pyusb. I first installed libusb and was successful, but now I'm having problems with pyusb (version 1.0.0).
I tried to install pyusb using the recommended command (in the pyusb folder): python setup.py install
From the output after running this command, it looks like it has installed with no problems. But when I try to run my simple program it gives an error:
File "/Users/michael/Desktop/usb.py", line 1, in import usb.core ImportError: No module named core
My python script tries to import usb.core, so if there's no module, then pyusb didn't install.
Other people have had the same problem. Their approach was to uninstall the old versions of pyusb, but to my knowledge, I have no previous installations.
How would it be possible to install the pyusb library?
Thanks in advance. I really appreciate your help.
--m
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试:
这对我有用。
Try:
It worked for me.
您决定将其命名为
usb.py
的脚本将被导入以代替 pyusb 提供的usb
包。重命名您的脚本。You script, which you have decided to call
usb.py
, is being imported in place of theusb
package provided by pyusb. Rename your script.