Hi all,
I'm trying to build the pyOCD(https://github.com/mbedmicro/pyOCD) into one
executable file under Ubuntu, and the pyOCD need a dependency library named
pyusb(https://github.com/walac/pyusb). I've a problem here, in pyusb
there's a *usb.backend.libusb0/libusb1/openusb module*, and there's a
function named *_load_library(find_library = None)*, which is used to load
libusb*.so under Linux.
Here's the problem:
In *PyInstaller/loader/rthooks/pyi_rth_usb.py*, there's also a function
named *_load_library()*, and the pyusb python code in elf generated by
pyinstaller will call *_load_library()* in *pyi_rth_usb.py *instead of _
*load_library*(*find_library = None*), which will raise a run-time
exception:
*code in pyusb:*
def get_backend(find_library=None):
global _lib
try:
if _lib is None:
_lib = *_load_library(find_library=find_library)*(the function
called here should be _load_library(find_library = None), but because of
runtime hook, the function prototype changed to _load_library(), which
leads to a function parameter type error)
_setup_prototypes(_lib)
return _LibUSB(_lib)
except usb.libloader.LibaryException:
*exception: *
2014-04-14 10:23:27,431 ERROR:usb.backend.libusb1:Error loading libusb 1.0
backend
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py",
line 879, in get_backend
_lib = _load_library(find_library=find_library)
TypeError: _load_library() takes no arguments (1 given)
*And the build output information is as follows:*
(part of them)
2213 INFO: Analyzing gdb_test.py
2266 INFO: Processing hook hook-usb
2461 INFO: Hidden import 'codecs' has been found otherwise
2461 INFO: Hidden import 'encodings' has been found otherwise
2461 INFO: Looking for run-time hooks
*2462 INFO: Analyzing rthook
/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/rthooks/pyi_rth_usb.pyobjdump:
section '.dynamic' mentioned in a -j option, but not found in any input
file*
Can I avoid using this run-time hook .py in order to fix this problem? If
yes, how can I do this?
Thanks a lot!
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.