python - PyInstaller with NumPy under Linux -


i trying convert python program stand-alone executable windows , linux. seemed pyinstaller solution task. got converted under windows, cannot make working linux (was probing on 2 different ubuntu machines). original python program reduced simple two-line code:

from numpy import log print '%8.6f' % log(5) 

which working fine when called like:

anton@op:~/bin$ python test_numpy.py 1.609438 

after compilation in pyinstaller, gives me error:

anton@op:~/bin/dist/test_numpy$ ./test_numpy traceback (most recent call last):   file "<string>", line 3, in <module>   file "/usr/local/lib/python2.7/dist-packages/pyinstaller-2.1-py2.7.egg/pyinstaller/loader/pyi_importers.py", line 270, in load_module     exec(bytecode, module.__dict__)   file "/home/anton/bin/build/test_numpy/out00-pyz.pyz/numpy", line 153, in <module>   file "/usr/local/lib/python2.7/dist-packages/pyinstaller-2.1-py2.7.egg/pyinstaller/loader/pyi_importers.py", line 270, in load_module     exec(bytecode, module.__dict__)   file "/home/anton/bin/build/test_numpy/out00-pyz.pyz/numpy.add_newdocs", line 13, in <module>   file "/usr/local/lib/python2.7/dist-packages/pyinstaller-2.1-py2.7.egg/pyinstaller/loader/pyi_importers.py", line 270, in load_module     exec(bytecode, module.__dict__)   file "/home/anton/bin/build/test_numpy/out00-pyz.pyz/numpy.lib", line 8, in <module>   file "/usr/local/lib/python2.7/dist-packages/pyinstaller-2.1-py2.7.egg/pyinstaller/loader/pyi_importers.py", line 270, in load_module     exec(bytecode, module.__dict__)   file "/home/anton/bin/build/test_numpy/out00-pyz.pyz/numpy.lib.type_check", line 11, in <module>   file "/usr/local/lib/python2.7/dist-packages/pyinstaller-2.1-py2.7.egg/pyinstaller/loader/pyi_importers.py", line 270, in load_module     exec(bytecode, module.__dict__)   file "/home/anton/bin/build/test_numpy/out00-pyz.pyz/numpy.core", line 6, in <module> importerror: cannot import name multiarray 

so problem related numpy library been not imported correctly.

i have tried adding hidden hooks pyinstaller suggested, nothing helps , getting error. ideas?

i able resolve problem.

this have found on hithub:

the executable pyinstaller builds not static, in still depends on system libc. under linux, abi of glibc backward compatible, not forward compatible. if link against newer glibc, can't run resulting executable on older system. supplied binary bootloader should work older glibc. however, libpython.so , other dynamic libraries still depends on newer glibc. solution compile python interpreter modules (and bootloader) on oldest system have around, gets linked oldest version of glibc.

so appeared current stable pyinstaller version outdated. not practical downgrade packages, upgraded pyinstaller latest development release (3.0.dev2) , voilĂ ! working dependencies correctly processed without custom hooks.

hope someone.


Comments