Ticket #388 (closed defect: fixed)
Frozen apps fails to run on OS X 10.7 Lion
| Reported by: | Giuseppe Di Martino | Owned by: | matysek |
|---|---|---|---|
| Priority: | high | Milestone: | PyInstaller 2.0 |
| Component: | Loader | Version: | 1.5 |
| Severity: | critical | Keywords: | Mac OS X, Lion, 10.7 |
| Cc: |
Description
My application frozen by PyInstaller? on Leopard runs fine in Leopard and Snow Leopard, but in Lion it prints on terminal the following error and terminates:
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib Expected in: /Applications/My? App Name.app/Contents/MacOS/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
Perhaps it is not a PyInstaller?'s problem, but has someone experienced it?
Attachments
Change History
comment:2 Changed 22 months ago by matysek
If a lot of changes are required in pyinstaller to work on lion, it would be hard to backport them for pyinstaller 1.5.
comment:4 in reply to: ↑ 3 Changed 22 months ago by Giuseppe Di Martino
Replying to matysek: Investigating on the problem I found that it is caused by libiconv.2.dylib and I discovered that it is different from the one present in /usr/lib of my development system (Leopard), so i replaced it from /usr/lib and now my application runs fine in Leopard, Snow Leopard and Lion. Perhaps PyInstaller? collects libiconv.2.dylib from /opt/lib because I used macports. Another strange thing I noted is that by executing in a terminal "iconv --version" gives 1.13 in Leopard and Snow Leopard, but 1.11 in Lion. For now this is a simple workaround, but if someone wants to investigate further, the definitive solution will be apprecied.
comment:5 Changed 22 months ago by matysek
- Milestone changed from PyInstaller 1.6 to PyInstaller 1.5.2
We should try pyinstaller 1.5 on Mac OS X 10.7 (lion) and see if we are able support 32bit apps on it with 1.5 branch.
comment:6 Changed 22 months ago by matysek
- Keywords Mac OS X, Lion, 10.7 added
- Priority changed from normal to high
- Severity changed from normal to critical
- Milestone changed from PyInstaller 1.5.2 to PyInstaller 1.6
I investigated further and found out the following:
- pyqt4 (or any other library) tries to load /usr/lib/libcups.2.dylib
- libcups requires iconv from Mac (/usr/lib/libiconv.2.dylib)
- since DYLD_LIBRARY_PATH / LD_LIBRARY_PATH is set by pyinstaller,
- /usr/lib/libcups.2.dylib is using libiconv from the pyinstaller bundle,
- but libiconv distributed with pyinstaller is incompatible with the one libcups on Mac OS X Lion requires.
- This issue was hidden until now, because the version of libcups is 2.8 and is same on Leopard (10.5) and Snow Leopard (10.6). However on Lion (10.7) the version is 2.9.
Possible solutions:
- package properly cups libraries with pyinstaller (if it is even a good idea)
- do not use DYLD_LIBRARY_PATH but update dylib libraries to find other dependent dylib relative to their path:
- I think that this is more general solution.
- python library macholib could do this job for us
- for the case (DY)LD_LIBRARY_PATH is set - bootloader would unset these variables
Fix won't be backported for 1.5 because the fix will require changing a lot of behavior of pyinstaller.
comment:8 Changed 20 months ago by matysek
- Summary changed from Frozen apps fails to run on OS X 1.7 Lion to Frozen apps fails to run on OS X 10.7 Lion
comment:10 Changed 20 months ago by matysek
On Mac there is a tool install_name_tool to change dynamic libraries to look for dl dependencies in relative paths.
Some links about dynamic libraries RPATH at unix/mac binaries:
- http://blogs.oracle.com/dipol/entry/dynamic_libraries_rpath_and_mac
- http://code.google.com/p/sidelight/wiki/RpathSaver
- https://wiki.ucar.edu/display/dasg/Building+with+shared+libs
- http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html
comment:11 follow-up: ↓ 12 Changed 20 months ago by Maarten Damen <m.damen@…>
What is the status of this ticket? I want to use PyInstaller? on Lion. Is there any work I can do?
comment:12 in reply to: ↑ 11 Changed 20 months ago by matysek
Replying to Maarten Damen <m.damen@…>:
What is the status of this ticket? I want to use PyInstaller? on Lion. Is there any work I can do?
In general, PyInstaller? should work on Lion.
But the issue is caused by a combination of some libraries and the way they are installed (like PyQt? and MacPorts?).
comment:13 Changed 19 months ago by mang
Not sure if this will work for everyone but I can build on Lion with the latest PyInstaller? SVN and the .app works on both Snow Leopard and Lion if I exclude libiconv.2.dylib during the build.
Here's the change I made to the generated .spec file: @@ -12,7 +12,7 @@
upx=True, console=False )
coll = COLLECT( exe,
- a.binaries,
+ a.binaries - [('libiconv.2.dylib', , )],
a.zipfiles, a.datas, strip=None,
comment:14 Changed 19 months ago by matysek
This should be fixed in latest svn (r1730).
comment:15 Changed 19 months ago by matysek
- Status changed from assigned to closed
- Resolution set to fixed

Lion is new and pyinstaller is not tested there yet. But some people already experienced it.
One idea: Could you, please, try freeze your app on mac 10.6 (snow leopard) as 64bit binary? And then trying running it on Lion if it work?
If it will work then it seems to be some issue with 32bit Lion compatibility.
But anyway, pyinstaller needs to be tested on this platform.