<p>我也有同样的错误,但是我没有成功地使用<code>find_library</code>(<code>TypeError: get_backend() got an unexpected keyword argument 'find_library'</code>)。
我想,虽然你没有说,但是<code>backend</code>是无效的(<code>None</code>)。</p>
<p>在路径<code>C:\Python27</code>中有libusb1实现吗?我想你没有把它安装到Python的文件夹中,如果是的话,你的答案是:<a href="https://stackoverflow.com/questions/5152133/pyusb-backend-not-accessible">PyUSB backend not accessible</a>。</p>
<p>否则,如果不使用<code>find_library</code>,则必须在<code>PATH</code>环境变量中提供libusb1实现。我是这样做的(您可以用您的位置替换<code>os.getcwd()</code>):</p>
<pre><code>def get_backend_libusb01():
libusb01_location = os.getcwd()
# load-library (ctypes.util.find_library) workaround: also search the current folder
is_current_folder_in_search_path = True
if None == usb.backend.libusb0.get_backend():
is_current_folder_in_search_path = libusb01_location in os.environ['PATH']
if not is_current_folder_in_search_path:
os.environ['PATH'] += os.pathsep + libusb01_location
backend = usb.backend.libusb0.get_backend()
if not is_current_folder_in_search_path:
os.environ['PATH'] = os.environ['PATH'].replace(os.pathsep + libusb01_location, "")
return backend
</code></pre>