我想在Windows 7上使用nfcpy。 因此,我按照https://nfcpy.readthedocs.io/en/latest/topics/get-started.html#installation
的说明进行操作当我执行 python -m nfc 时,出现以下错误:
$ python -m nfc
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 163, in run_module_as_main
mod_name, Error)
File "C:\Python27\lib\runpy.py", line 111, in get_module_details
import(mod_name) # Do not catch exceptions initializing package
File "C:\Python27\lib\site-packages\nfc_init.py", line 22, in
from . import clf # noqa: F401
File "C:\Python27\lib\site-packages\nfc\clf_init.py", line 25, in
from . import device
File "C:\Python27\lib\site-packages\nfc\clf\device.py", line 32, in
from . import transport
File "C:\Python27\lib\site-packages\nfc\clf\transport.py", line 31, in
import usb1 as libusb
File "C:\Python27\lib\site-packages\usb1_init.py", line 61, in
from . import libusb1
File "C:\Python27\lib\site-packages\usb1\libusb1.py", line 199, in
libusb = _loadLibrary()
File "C:\Python27\lib\site-packages\usb1\libusb1.py", line 173, in loadLibrary
return dll_loader('libusb-1.0' + suffix, **loader_kw)
File "C:\Python27\lib\ctypes_init.py", line 366, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application
我尝试了2个不同的python 2.7安装程序版本:
-> Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [**MSC v.1500 64 bit (AMD64)**] on win32
-> Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [**MSC v.1500 32 bit (Intel)**] on win32
我对两者都有同样的错误。
答案 0 :(得分:1)
将MS32 \ dll \ libusb-1.0.dll复制到C:\ Windows \ SysWOW64目录。