Closed MagnusKnutas closed 6 years ago
I've had the same issue, and it was because i used the default python from MacOS X ( /usr/bin/python ) if i use the one from ( /usr/local/bin/python ) it works
The solution from loopingz didn't work in my case, there is no /usr/local/bin/python on my operating system.
But I found a workaround. I already had the same kind of issue with py2app alone and it seems to be the same issue with esky when using py2app.
For an unknown reason, py2app does not look for python modules on the host computer, it only looks in the ####.app directories. And guess what ? Because fcntl is a standard python package, it is not packaged with in the ####.app.
The solution consists to indicate to py2app to look after python modules in the host directories. Here is the solution:
In the setup.py file
setup_kwargs['options'] = {
'py2app': {
'plist': {
'PyResourcePackages': [
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/'
]
}
},
'bdist_esky': {
'freezer_module': 'py2app',
'freezer_options': {
'plist': {
'PyResourcePackages': [
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/'
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/'
]
}
}
}
}
This solution is verbose on purpose and can be easily improved/simplified. Notice the fact that the plist
informations are duplicated in py2app
and in freezer_options
. Esky does not retrieve information from py2app
field and py2app does not retrieve information from bdist_esky
field... So if you want to have a generic setup.py able to build app with py2app or with esky+py2app, the information needs to be duplicated.
For a basic application, only these two directories need to be added in PyResourcePackages
, but if you use advanced application, for example with a graphical interface, maybe more directories need to be added. In my case, the app uses wxPython, and the following directory was needed:
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/
Thanks for reaching out. Unfortunately this project is no longer actively maintained, so I'm going to move it into archive mode:
https://rfk.id.au/blog/entry/archiving-open-source-projects/
When i run my setup everything works except that esky do not include fcntl to my .app (in the OSX version) code:
When i run program