Michel Allaire
2015-03-02 05:06:05 UTC
Hi,
In my current project I must communicate through the USB bus with several
micro controllers which are USB ready.
I want to do this in Python running on Windows 7-64bits.
PyUSB 1.0.0b2 is installed as well as libusb-win32 (
libusb-win32-devel-filter-1.2.6.0.exe was used without adding a filter for a
particular device)
The file libusb0.dll is present in C:\Windows\System32\ and the file
libusb0.sys is present in C:\Windows\System32\drivers\.
My test script is the following
import os
os.environ['PYUSB_DEBUG']='debug'
os.environ['PYUSB_LOG_FILENAME']="D:\LOG_ERR_TEST.txt"
import usb.core
import usb.util
dev = usb.core.find(find_all = True)
And it produces the following error:
Traceback (most recent call last):
File "C:\Python34\Test PYUSB.py", line 13, in <module>
dev = usb.core.find(find_all = True)
File "C:\Python34\usb\core.py", line 1219, in find
raise ValueError('No backend available')
ValueError: No backend available
The error log file goes like this:
2015-02-27 22:22:24,995 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:22:24,996 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:22:25,000 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:22:25,001 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:22:25,012 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:22:25,013 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:25:16,570 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:25:16,571 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:25:16,575 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:25:16,576 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:25:16,586 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:25:16,588 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:35:31,821 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:35:31,822 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:35:31,827 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:35:31,827 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:35:31,838 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:35:31,840 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:40:53,266 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:40:53,267 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:40:53,272 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:40:53,272 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:40:53,282 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide
2015-02-27 22:40:53,284 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:41:37,963 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:41:37,964 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:41:37,969 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:41:37,969 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:41:37,979 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:41:37,981 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:42:38,367 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:42:38,368 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:42:38,372 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:42:38,373 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:42:38,383 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide
2015-02-27 22:42:38,384 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-28 12:23:20,858 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-28 12:23:20,858 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-28 12:23:20,858 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-28 12:23:20,858 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-28 12:23:20,858 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-28 12:23:20,878 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-28 16:51:36,357 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-28 16:51:36,367 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-28 16:51:36,367 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-28 16:51:36,367 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-28 16:51:36,367 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-28 16:51:36,367 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
Can you help me solve this problem?
Thanking you in advance
Michel Allaire
In my current project I must communicate through the USB bus with several
micro controllers which are USB ready.
I want to do this in Python running on Windows 7-64bits.
PyUSB 1.0.0b2 is installed as well as libusb-win32 (
libusb-win32-devel-filter-1.2.6.0.exe was used without adding a filter for a
particular device)
The file libusb0.dll is present in C:\Windows\System32\ and the file
libusb0.sys is present in C:\Windows\System32\drivers\.
My test script is the following
import os
os.environ['PYUSB_DEBUG']='debug'
os.environ['PYUSB_LOG_FILENAME']="D:\LOG_ERR_TEST.txt"
import usb.core
import usb.util
dev = usb.core.find(find_all = True)
And it produces the following error:
Traceback (most recent call last):
File "C:\Python34\Test PYUSB.py", line 13, in <module>
dev = usb.core.find(find_all = True)
File "C:\Python34\usb\core.py", line 1219, in find
raise ValueError('No backend available')
ValueError: No backend available
The error log file goes like this:
2015-02-27 22:22:24,995 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:22:24,996 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:22:25,000 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:22:25,001 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:22:25,012 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:22:25,013 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:25:16,570 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:25:16,571 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:25:16,575 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:25:16,576 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:25:16,586 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:25:16,588 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:35:31,821 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:35:31,822 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:35:31,827 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:35:31,827 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:35:31,838 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:35:31,840 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:40:53,266 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:40:53,267 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:40:53,272 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:40:53,272 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:40:53,282 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide
2015-02-27 22:40:53,284 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:41:37,963 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:41:37,964 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:41:37,969 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:41:37,969 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:41:37,979 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-27 22:41:37,981 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-27 22:42:38,367 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-27 22:42:38,368 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-27 22:42:38,372 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-27 22:42:38,373 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-27 22:42:38,383 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide
2015-02-27 22:42:38,384 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-28 12:23:20,858 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-28 12:23:20,858 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-28 12:23:20,858 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-28 12:23:20,858 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-28 12:23:20,858 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-28 12:23:20,878 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
2015-02-28 16:51:36,357 ERROR:usb.libloader:'Libusb 1' could not be found
2015-02-28 16:51:36,367 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
2015-02-28 16:51:36,367 ERROR:usb.libloader:'OpenUSB library' could not be
found
2015-02-28 16:51:36,367 ERROR:usb.backend.openusb:Error loading OpenUSB
backend
2015-02-28 16:51:36,367 ERROR:usb.libloader:Libusb 0
(C:\WinAVR-20100110\bin\libusb0.dll) could not be loaded
Traceback (most recent call last):
File "C:\Python34\usb\libloader.py", line 116, in load_library
return ctypes.CDLL(lib)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 n'est pas une application Win32 valide (in
English : "not a valid Win32 application")
2015-02-28 16:51:36,367 ERROR:usb.backend.libusb0:Error loading libusb 0.1
backend
Can you help me solve this problem?
Thanking you in advance
Michel Allaire