New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usb.core NoBackendError #1891
Comments
This is not helpful. I do try to solve problem reading this already. |
The error message clearly says |
Something is wrong here. |
When you bundle with The question is, what is this "backend" thing that is not being picked up? The question is a little easier to answer if you bundle with the What is this module |
Hello...
|
Sorry, I did not understand the lib was called pyusb. Now I see it at pypi.
and also,
So, yes, there is perhaps some problem with the hook. |
the pyusb support libusb01, libusb10, libusbx, libusb-win, openUsb.... and only one need to be present. so I assume that missing libusb10 and libusb1 is not important in my case but missing libusb01 it is as I rely on this one. And I assume that hook is the trouble... |
I try do do some debug. in hook-usb.py I just print result and library is found. So that part seems to work.
and result is
so librrary libusb1, libusb0 and openusb are found!
and got
so this seems to work too.
And there I don't get any output. so that loop (for) is not executed at all! Any idea? |
Did you determine which library is being loaded/used when the application is not frozen? |
Hello... |
...maybe library loaded is device dependant as I do communicate with more physical devices. |
I'm having the same problem right now (using PyInstaller 3.2 on Windows 10), so I try to give some more input: The NoBackendError from the original report is in fact caused by pyusb not being able to find a libusb*.dll - manually copying the DLL to the dist/project folder fixes that, and the application will work as expected. But of course we cannot build a single .EXE that way, which is what I'd like to do. Looking at hook-usb.py, it seems that the hook intends to add the DLL to binaries, but fails to actually do so, because the DLL in question is installed to C:\Windows\System32, and Unfortunately I'm not familiar enough with PyInstaller's concepts to actually solve that problem. I tried to modify hook-usb.py so that the DLL is not excluded, but then it gets copied to into a subfolder "libusb0.dll", which does not work either (it must be in the output dir directly, otherwise pyusb won't find it). The same happens if I try to add it manually in the .spec file through binaries. How can we add some files directly to the output folder root, without subdirectory, like PyInstaller 2.1 does it? |
Update: The following seems to work (in the .spec file):
|
I think I found the problem in the hook, as you noted it was the directory. I fixed that and added another detection method which uses the pyusb finder directly. I have a branch with the changed hook 23901eb. If you could try the hook, that would be great. The test framework is currently not running the test for usb, and I am trying to get that going next. |
Thanks very much. I could solve the problem with your solution. |
How are you modifying the .spec file? I am using the command line interface for this so it looks like this: EDIT: Everything works now. Will leave this here if anyone is confused like I was. |
Hello...
I'm not expert in python nor pyinstaller. But I try all (at least I think) possible solutions to solve problem.
So as problem is near same as in other example I steal minimal program and it is this piece:
all work is done in WinXP running virtualbox hosted by ubuntu.
and result is:
I do compile with:
pyinstaller -F c:\xx\t.py
and here is log:Warnings written to C:\xx\build\t\warnt.txt
I do try to use development version of pyinstaller but seems to be even worse. Here are the outputs:
``
C:\xx>pyinstaller -F c:\xx\t.py
100 INFO: PyInstaller: 3.2.dev0+9dc28c0
100 INFO: Python: 2.7.11
100 INFO: Platform: Windows-XP-5.1.2600-SP3
100 INFO: wrote C:\xx\t.spec
100 INFO: UPX is not available.
100 INFO: Extending PYTHONPATH with paths
['c:\xx', 'C:\xx']
100 INFO: checking Analysis
100 INFO: Building Analysis because out00-Analysis.toc is non existent
100 INFO: Initializing module dependency graph...
111 INFO: Initializing module graph hooks...
151 INFO: running Analysis out00-Analysis.toc
171 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
required by C:\Python27\python.exe
171 INFO: Found C:\WINDOWS\WinSxS\Policies\x86_policy.9.0.Microsoft.VC90.CRT_1fc
8b3b9a1e18e3b_x-ww_b7353f75\9.0.30729.1.policy
171 INFO: Found C:\WINDOWS\WinSxS\Policies\x86_policy.9.0.Microsoft.VC90.CRT_1fc
8b3b9a1e18e3b_x-ww_b7353f75\9.0.30729.4148.policy
180 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.307
29.4148_x-ww ...
180 INFO: Found manifest C:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC90.CRT_1fc8
b3b9a1e18e3b_9.0.30729.4148_x-ww_d495ac4e.manifest
180 INFO: Searching for file msvcr90.dll
180 INFO: Found file C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9
.0.30729.4148_x-ww_d495ac4e\msvcr90.dll
180 INFO: Searching for file msvcp90.dll
180 INFO: Found file C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9
.0.30729.4148_x-ww_d495ac4e\msvcp90.dll
180 INFO: Searching for file msvcm90.dll
180 INFO: Found file C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9
.0.30729.4148_x-ww_d495ac4e\msvcm90.dll
180 INFO: Found C:\WINDOWS\WinSxS\Policies\x86_policy.9.0.Microsoft.VC90.CRT_1fc
8b3b9a1e18e3b_x-ww_b7353f75\9.0.30729.1.policy
180 INFO: Found C:\WINDOWS\WinSxS\Policies\x86_policy.9.0.Microsoft.VC90.CRT_1fc
8b3b9a1e18e3b_x-ww_b7353f75\9.0.30729.4148.policy
180 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,
30729, 4148)
230 INFO: Analyzing c:\xx\t.py
1562 INFO: Looking for import hooks ...
1572 INFO: Processing hook hook-usb.py
1582 INFO: Processing hook hook-encodings.py
2003 INFO: Looking for ctypes DLLs
2023 INFO: Analyzing run-time hooks ...
2023 INFO: Including run-time hook 'pyi_rth_usb.py'
2032 INFO: Looking for dynamic libraries
2082 INFO: Looking for eggs
2082 INFO: Using Python library C:\WINDOWS\system32\python27.dll
2082 INFO: Found binding redirects:
[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVers
ion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 4148), publicKeyToken=u'1fc8b3b9a
1e18e3b')]
2082 INFO: Warnings written to C:\xx\build\t\warnt.txt
2132 INFO: checking PYZ
2132 INFO: Building PYZ because out00-PYZ.toc is non existent
2132 INFO: Building PYZ (ZlibArchive) C:\xx\build\t\out00-PYZ.pyz
2533 INFO: checking PKG
2533 INFO: Building PKG because out00-PKG.toc is non existent
2533 INFO: Building PKG (CArchive) out00-PKG.pkg
2553 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 307
29, 4148)
3725 INFO: Bootloader C:\Python27\lib\site-packages\pyinstaller-3.2.dev0+9dc28c0
-py2.7.egg\PyInstaller\bootloader\Windows-32bit\run.exe
3725 INFO: checking EXE
3725 INFO: Building EXE because out00-EXE.toc is non existent
3725 INFO: Building EXE from out00-EXE.toc
3725 INFO: Appending archive to EXE C:\xx\dist\t.exe
missing module named usb.core.USBError - imported by usb.core, usb.backend.libusb1, usb.backend.libusb0, usb.backend.openusb
missing module named _functools.partial - imported by _functools, functools
missing module named _functools.reduce - imported by _functools, functools
missing module named struct.calcsize - imported by struct, ctypes
missing module named _struct.doc - imported by _struct, struct
missing module named _struct._clearcache - imported by _struct, struct
missing module named _hashlib.pbkdf2_hmac - imported by _hashlib, hashlib
missing module named binascii.hexlify - imported by binascii, random
missing module named binascii.b2a_qp - imported by binascii, quopri
missing module named binascii.a2b_qp - imported by binascii, quopri
missing module named binascii.a2b_uu - imported by binascii, encodings.uu_codec
missing module named binascii.b2a_uu - imported by binascii, encodings.uu_codec
missing module named os.urandom - imported by os, random
missing module named math.sin - imported by math, random
missing module named math.sqrt - imported by math, random
missing module named math.cos - imported by math, random
missing module named math.acos - imported by math, random
missing module named math.ceil - imported by math, random
missing module named math.exp - imported by math, random
missing module named math.log - imported by math, random
missing module named math.e - imported by math, random
missing module named math.pi - imported by math, random
missing module named threading.RLock - imported by threading, _threading_local
missing module named threading.current_thread - imported by threading, _threading_local
missing module named thread._local - imported by thread, threading
missing module named thread.stack_size - imported by thread, threading
missing module named time.time - imported by time, threading
missing module named time.sleep - imported by time, threading
missing module named thread.allocate_lock - imported by thread, _strptime
missing module named datetime.date - imported by datetime, _strptime
missing module named _sre.MAXREPEAT - imported by _sre, sre_constants
missing module named strop.whitespace - imported by strop, string
missing module named strop.maketrans - imported by strop, string
missing module named strop.lowercase - imported by strop, string
missing module named strop.uppercase - imported by strop, string
missing module named re._compile - imported by re, sre
missing module named re.all - imported by re, sre
missing module named itertools.chain - imported by itertools, tokenize, heapq, collections
missing module named errno.EINVAL - imported by errno, StringIO
missing module named cStringIO.StringIO - imported by cStringIO, gettext, pprint, shlex, tempfile, pickle, encodings.uu_codec, quopri, encodings.quopri_codec
missing module named errno.ENOENT - imported by errno, gettext
missing module named itertools.count - imported by itertools, heapq, threading
missing module named itertools.groupby - imported by itertools, usb.legacy
missing module named itertools.ifilterfalse - imported by itertools, sets
missing module named itertools.ifilter - imported by itertools, sets
missing module named itertools.starmap - imported by itertools, collections
missing module named itertools.repeat - imported by itertools, collections
missing module named itertools.imap - imported by itertools, heapq, collections
missing module named itertools.tee - imported by itertools, heapq
missing module named itertools.izip - imported by itertools, heapq
missing module named itertools.islice - imported by itertools, repr, heapq
missing module named collections.deque - imported by collections, shlex, threading
missing module named fcntl - imported by tempfile, subprocess
missing module named _io.DEFAULT_BUFFER_SIZE - imported by _io, io
missing module named _io.BytesIO - imported by _io, io
missing module named _io.open - imported by _io, io
missing module named _io.BufferedWriter - imported by _io, io
missing module named _io.FileIO - imported by _io, io
missing module named _io.BlockingIOError - imported by _io, io
missing module named _io.IncrementalNewlineDecoder - imported by _io, io
missing module named _io.BufferedReader - imported by _io, io
missing module named _io.BufferedRandom - imported by _io, io
missing module named _io.StringIO - imported by _io, io
missing module named _io.BufferedRWPair - imported by _io, io
missing module named _io.TextIOWrapper - imported by _io, io
missing module named _io.UnsupportedOperation - imported by _io, io
missing module named _weakref.ref - imported by _weakref, _weakrefset, weakref
missing module named _weakref.ReferenceType - imported by _weakref, weakref
missing module named _weakref.proxy - imported by _weakref, weakref
missing module named _weakref.getweakrefs - imported by _weakref, weakref
missing module named _weakref.getweakrefcount - imported by _weakref, weakref
missing module named _weakref.ProxyType - imported by _weakref, weakref
missing module named _weakref.CallableProxyType - imported by _weakref, weakref
missing module named nt._isdir - imported by nt, ntpath
missing module named nt._getfullpathname - imported by nt, ntpath
missing module named nt._exit - imported by nt, os
missing module named readline - imported by cmd, pdb
missing module named pwd - imported by posixpath
missing module named copy.deepcopy - imported by copy, weakref, sets
missing module named exceptions.ReferenceError - imported by exceptions, weakref
missing module named operator.attrgetter - imported by operator, inspect
missing module named cPickle.loads - imported by cPickle, collections
missing module named cPickle.dumps - imported by cPickle, collections
missing module named thread.get_ident - imported by thread, collections
missing module named collections.OrderedDict - imported by collections, unittest.util
missing module named collections.namedtuple - imported by collections, inspect, unittest.util, difflib, doctest
missing module named operator.itemgetter - imported by operator, collections, heapq
missing module named operator.eq - imported by operator, collections
missing module named _collections.deque - imported by _collections, collections
missing module named _collections.defaultdict - imported by _collections, collections
missing module named _warnings.warn_explicit - imported by _warnings, warnings
missing module named _warnings.filters - imported by _warnings, warnings
missing module named _warnings.once_registry - imported by _warnings, warnings
missing module named _warnings.default_action - imported by _warnings, warnings
missing module named _warnings.warn - imported by _warnings, warnings
missing module named org.PyStringMap - imported by org, copy
missing module named org - imported by copy
missing module named sys.hexversion - imported by sys, usb.util
missing module named 'usb.backend.libusb01' - imported by C:\Python27\lib\site-packages\pyinstaller-3.2.dev0+9dc28c0-py2.7.egg\PyInstaller\loader\rthooks\pyi_rth_usb.py
missing module named 'usb.backend.libusb10' - imported by C:\Python27\lib\site-packages\pyinstaller-3.2.dev0+9dc28c0-py2.7.egg\PyInstaller\loader\rthooks\pyi_rth_usb.py
missing module named _subprocess.STD_OUTPUT_HANDLE - imported by _subprocess, subprocess
missing module named _subprocess.CREATE_NEW_PROCESS_GROUP - imported by _subprocess, subprocess
missing module named _subprocess.STD_INPUT_HANDLE - imported by _subprocess, subprocess
missing module named _subprocess.STARTF_USESHOWWINDOW - imported by _subprocess, subprocess
missing module named _subprocess.CREATE_NEW_CONSOLE - imported by _subprocess, subprocess
missing module named _subprocess.STD_ERROR_HANDLE - imported by _subprocess, subprocess
missing module named _subprocess.STARTF_USESTDHANDLES - imported by _subprocess, subprocess
missing module named _subprocess.SW_HIDE - imported by _subprocess, subprocess
missing module named 'org.python'.PyStringMap - imported by 'org.python', pickle
missing module named 'org.python' - imported by pickle
missing module named riscosenviron._Environ - imported by riscosenviron, os
missing module named riscosenviron - imported by os
missing module named riscospath - imported by os
missing module named riscos._exit - imported by riscos, os
missing module named riscos - imported by os
missing module named ce._exit - imported by ce, os
missing module named ce - imported by os
missing module named _emx_link.link - imported by _emx_link, os
missing module named _emx_link - imported by os
missing module named os2._exit - imported by os2, os
missing module named os2 - imported by os
missing module named posix._exit - imported by posix, os
missing module named posix - imported by os
missing module named resource - imported by posix
missing module named _ctypes._wstring_at_addr - imported by _ctypes, ctypes
missing module named _ctypes._string_at_addr - imported by _ctypes, ctypes
missing module named _ctypes._cast_addr - imported by _ctypes, ctypes
missing module named _ctypes._memset_addr - imported by _ctypes, ctypes
missing module named _ctypes._memmove_addr - imported by _ctypes, ctypes
missing module named _ctypes.get_last_error - imported by _ctypes, ctypes
missing module named _ctypes.set_last_error - imported by _ctypes, ctypes
missing module named _ctypes._check_HRESULT - imported by _ctypes, ctypes
missing module named _ctypes.set_conversion_mode - imported by _ctypes, ctypes
missing module named _ctypes._pointer_type_cache - imported by _ctypes, ctypes
missing module named _ctypes.POINTER - imported by _ctypes, ctypes
missing module named _ctypes._SimpleCData - imported by _ctypes, ctypes
missing module named _ctypes.get_errno - imported by _ctypes, ctypes
missing module named _ctypes.set_errno - imported by _ctypes, ctypes
missing module named _ctypes.alignment - imported by _ctypes, ctypes
missing module named _ctypes.addressof - imported by _ctypes, ctypes
missing module named _ctypes.resize - imported by _ctypes, ctypes
missing module named _ctypes.byref - imported by _ctypes, ctypes
missing module named _ctypes.sizeof - imported by _ctypes, ctypes
missing module named _ctypes.dlopen - imported by _ctypes, ctypes
missing module named _ctypes.FUNCFLAG_STDCALL - imported by _ctypes, ctypes
missing module named _ctypes.LoadLibrary - imported by _ctypes, ctypes
missing module named _ctypes.FUNCFLAG_USE_ERRNO - imported by _ctypes, ctypes
missing module named _ctypes.FUNCFLAG_USE_LASTERROR - imported by _ctypes, ctypes
missing module named _ctypes.FUNCFLAG_PYTHONAPI - imported by _ctypes, ctypes
missing module named _ctypes.FUNCFLAG_CDECL - imported by _ctypes, ctypes
missing module named _ctypes.FormatError - imported by _ctypes, ctypes
missing module named _ctypes.ArgumentError - imported by _ctypes, ctypes
missing module named _ctypes.RTLD_LOCAL - imported by _ctypes, ctypes
missing module named _ctypes.RTLD_GLOBAL - imported by _ctypes, ctypes
missing module named _ctypes.version - imported by _ctypes, ctypes
missing module named _ctypes.CFuncPtr - imported by _ctypes, ctypes
missing module named _ctypes._Pointer - imported by _ctypes, ctypes
missing module named _ctypes.Structure - imported by _ctypes, ctypes
missing module named _ctypes.Array - imported by _ctypes, ctypes
missing module named _ctypes.Union - imported by _ctypes, ctypes
missing module named unicodedata.ucd_3_2_0 - imported by unicodedata, stringprep, encodings.idna
missing module named codecs.mbcs_encode - imported by codecs, encodings.mbcs
missing module named codecs.mbcs_decode - imported by codecs, encodings.mbcs
The text was updated successfully, but these errors were encountered: