Problem with conflicting .so files pyinstaller/pyinstaller#1105
To reproduce:
-
Download the gist
-
Gist doesn't support directories, so manually create the submodule:
$ mkdir submodule $ mv __init__.py _random.pyx submodule/
-
Use cython to compile the .so:
$ python setup.py build_ext --inplace
-
Run normally, it works:
$ python pyi_so_conflict.py success!
-
Run through
pyinstaller --onedir
, it works:$ pyinstaller --onedir --name=onedir pyi_so_conflict.py [...] $ dist/onedir/onedir success!
-
Run through
pyinstaller --onefile
, it fails:$ pyinstaller --onefile --name=onefile pyi_so_conflict.py [...] $ dist/onefile Traceback (most recent call last): File "<string>", line 2, in <module> File "/usr/local/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module exec(bytecode, module.__dict__) File "/Users/ronen/test/pyi_so_conflict/build/onefile/out00-PYZ.pyz/submodule", line 1, in <module> ImportError: cannot import name subfunc
Platform details:
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.1
BuildVersion: 14B25
$ python --version
Python 2.7.9
$ pyinstaller --version
2.1