I have just made a small little app of a Python wxPython script with py2app. Everything worked as advertised, but the app is pretty big in size. Is there any way to optimize py2app to make the app smaller in size?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a workaround.
It will depend on which OS you want to target. Python and wxPython are bundled with every Mac OS X installation (at least starting with Leopard, if I recall correctly)
What you might try, is to add the
--aliascompilation option. According to the py2app doc:So that the app will try to use the Mac OS X version of wxPython.
CAREFUL
The alias option is called development mode.
If you use another library that is not bundled with Mac OS X, it won’t work.
If you want to port your application to Windows or Linux, it won’t work.
I’ve had some successful use with this method but in the end, went back to zipping a 30/40MB file. Which in the end is not that big.