[Pythonmac-SIG] py2app - After building for distribution, No module named PyObjCTools

s s listsin at integrateddevcorp.com
Sun Feb 8 17:25:57 CET 2009


I have had similar problems with the "ImportError: No module named  
PyObjCTools" and actually sent my entire project to someone who was  
distributing a (beta) commercial product for some help.

He spent 4 hours on it, hacked the hell out of the startup modules and  
everything else and got it to build on his machine, then I couldn't  
duplicate his results on mine.

py2app needs some serious attention on the 10.5.6 stack and I'm  
willing to help get it going -- I just don't have the domain knowledge  
to get the ball rolling though I'm sure I could help keep it rolling  
once I knew where to poke the stick.

S
>
On Feb 8, 2009, at 2:32 AM, Jacob wrote:

> Hi guys,
>
> I'm have a little trouble with py2app when building an app for  
> distribution.  I'll give an example using one of the py2app/pyobjc2  
> examples, ICSharingWatcher.  I setup Python 2.5.4 using MacPorts  
> 1.7.0, along with the following packages:
>
> py25-bdist_mpkg @0.4.3_0 (active)
> py25-macholib-devel @1.2_0 (active)
> py25-modulegraph-devel @0.7.2_0 (active)
> py25-py2app-devel @0.4.2_1 (active)
> py25-pyobjc2 @2.0_1 (active)
> py25-pyobjc2-cocoa @2.0_1 (active)
> py25-setuptools @0.6c9_0 (active)
> py25-zlib @2.5.4_0 (active)
> python25 @2.5.4_0+darwin_9+macosx (active)
> python_select @0.2.1_0+darwin_9 (active)
>  * Some other modules were removed for brevity.
>
> With the MacPorts version selected, in the ICSharingWatcher example,  
> if I execute "python setup.py py2app", I get the following error  
> message:
>
>  pkg_resources.DistributionNotFound: pyobjc
>
> If I modify "setup.py" and change "install_requires=["pyobjc"]," to  
> "install_requires=["pyobjc-core"]," or just comment out the line,  
> then I can successfully build the example.  However, on startup it  
> complains "ImportError: No module named PyObjCTools".
>
> I can clean up the build and dist directories, execute "python  
> setup.py py2app -A" with this modified setup.py and the example runs  
> just fine.  I can run MacPort's python and import PyObjCTools  
> without a problem.  So, it seems that I'm just not telling py2app  
> how to correctly include PyObjCTools.
>
> Any ideas why the "pyobjc" package cannot be found?  I'm running  
> 10.5.6 and have XCode 3.1.2 installed.
>
> Thanks,
> Jacob
>
> --------------------------------------------------
> For reference, the setup.py in the example looks like:
>
> from setuptools import setup
>
> setup(
>    data_files=['MainMenu.nib'],
>    app=['ICSharingWatcher.py'],
>    install_requires=["pyobjc"],
>    setup_requires=["py2app"],
> )
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig



More information about the Pythonmac-SIG mailing list