Re: [Pyobjc-dev] Help getting Started with PyObjc2 and Leopard
Brought to you by:
ronaldoussoren
|
From: Barry W. <bar...@gm...> - 2007-11-29 16:35:24
|
So is it the official stand now that users should install new/updated packages in the system python? My understanding (well, from Tiger days) was that the system's python should not be modified since system services depend on it. This seems to be the unstated rule with Leopard, since the system python puts its own setuptools, numpy etc. packages in sys.path before /Library/Python/2.5/site-packages. So, if we don't install a framework build of Python, it looks like we either have to interfere with system dependencies (such as numpy, setuptools, pyobjc2?, etc.) or be stuck with the version that shipped in Leopard (numpy 1.0.4 is now available, for example). Unfortunately, pyobjc2 won't work with the pyhton.org framework build because the framework build was built using the 10.4u.sdk (see a previous post by me on this subject). However, it's not hard to build a framework build from the python.org source (there's a script that does just that in the source tree). Once python is built with the 10.5.sdk, pyobjc2 compiles and works just fine (we've been using it in production for a few days already). I'm not sure how to compile in dtrace support, but if you can live without that, everything else appears to work. Does anyone know how to add dtrace support to Python or does it require Apple's patches to the interpreter? Perhaps someone from Apple would be willing to comment... Thanks, Barry On 11/29/07, Ronald Oussoren <ron...@ma...> wrote: > > On 29 Nov, 2007, at 15:13, George Armah wrote: > > > Hello, > > > > This is my first attempt at using pyobjc and I run into some problems. > > The problem you're having is that you have a python framework in / > Library/Frameworks. The easiest way to fix your problems is to remove > that framework (or move it aside if you want to check which site- > packages need to be reinstalled). > > The system install of python is 2.5.1 + dtrace support and there is > therefore no need to install a python framework in /Library/ > Frameworks. Well, at least not unless you want to build > redistributable applications for OSX 10.4 using py2app. > > Ronald > > > > > > > I created a new project using XCode 3.0 with the Cocoa-Python > > Application template. > > I then proceeded to do a build on the application (n.b. I haven't > > added any of my own code yet) and the build succeeded. > > When I do a build and run however, I get the following error message > > in console: > > > > //-------------------------------------------------------------------------------------------------------------------------------- > > The Debugger Debugger is attaching to process > > [Session started at 2007-11-29 08:32:29 -0500.] > > Traceback (most recent call last): > > File "/Users/Armahg/Builds/Release/again.app/Contents/Resources/ > > main.py", line 10, in <module> > > import objc > > ImportError: No module named objc > > 2007-11-29 08:32:29.349 again[2542:10b] *** Terminating app due to > > uncaught exception 'NSInternalInconsistencyException', reason: '/ > > Users/Armahg/again/main.m:46 main() PyRun_SimpleFile failed with > > file '/Users/Armahg/Builds/Release/again.app/Contents/Resources/ > > main.py'. See console for errors.' > > 2007-11-29 08:32:29.352 again[2542:10b] Stack: ( > > 2488480363, > > 2511437979, > > 2488479819, > > 2488479882 > > ) > > //-------------------------------------------------------------------------------------------------------------------------------- > > >From what I have read, i thought pyobjC2 should work right out of > > the box with Leopard. Is there anything configuration I have to do > > to get the app working? > > > > > > I also tried to run some of the PyObjc examples and received the > > following error message > > > > //-------------------------------------------------------------------------------------------------------------------------------- > > Armahg:CurrencyConverter Armahg$ python setup.py py2app > > Traceback (most recent call last): > > File "setup.py", line 8, in <module> > > import py2app > > ImportError: No module named py2app > > //-------------------------------------------------------------------------------------------------------------------------------- > > > > TroubleShooting done so far: > > > > My current path for Python is: > > Armahg$ which python > > /Library/Frameworks/Python.framework/Versions/Current/bin/python > > > > I modified the main.m file in my test PyObjc app to read > > /*Py_SetProgramName("/usr/bin/python");*/ > > Py_SetProgramName("/Library/Frameworks/Python.framework/Versions/ > > Current/bin/python"); > > > > and this has not helped either. > > > > > > Any help given would be much appreciated. Also, in return, I'll > > document what I do and post it somewhere online so that > > other newcomers won't have to email this dev list with the same > > problem again :) > > > > Thanks in advance , > > > > George. > > > > > > > > > > > > ------------------------------------------------------------------------- > > SF.Net email is sponsored by: The Future of Linux Business White Paper > > from Novell. From the desktop to the data center, Linux is going > > mainstream. Let it simplify your IT future. > > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4_______________________________________________ > > Pyobjc-dev mailing list > > Pyo...@li... > > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > > |