Issue 6812: Snow Leopard python program fails because _PyType_Modified is missing from python framework (original) (raw)
Attempts to compile a simple example using XCode 3.2 (Xcode IDE: 1610.0, Xcode Core: 1608.0, ToolSupport: 1591.0)under Snow Leopard fail with error message Traceback (most recent call last): File "/Users/seamus/Science/xcode exploration/Objc- programs/First_PyObjC/build/Debug/First_PyObjC.app/Contents/Resources/ma in.py", line 10, in import objc File "/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib /python/PyObjC/objc/init.py", line 22, in _update() File "/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib /python/PyObjC/objc/init.py", line 19, in _update import _objc ImportError: dlopen(/System/Library/Frameworks/Python.framework/Versions/Current/Extr as/lib/python/PyObjC/objc/_objc.so, 2): Symbol not found: _PyType_Modified Referenced from: /System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib/ python/PyObjC/objc/_objc.so Expected in: flat namespace in /System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib/ python/PyObjC/objc/_objc.so 2009-08-31 08:31:23.534 First_PyObjC[4072:a0f] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '/Users/seamus/Science/xcode exploration/Objc- programs/First_PyObjC/main.m:46 main() PyRun_SimpleFile failed with file '/Users/seamus/Science/xcode exploration/Objc- programs/First_PyObjC/build/Debug/First_PyObjC.app/Contents/Resources/ma in.py'. See console for errors.' *** Call stack at first throw: ( 0 CoreFoundation 0x90a1858a __raiseError
- 410 1 libobjc.A.dylib 0x9309cf49 objc_exception_throw + 56 2 CoreFoundation 0x90a182b8 +[NSException raise:format:arguments:] + 136 3 CoreFoundation 0x90a1822a +[NSException raise:format:] + 58 4 First_PyObjC 0x00002bc2 main + 1084 5 First_PyObjC 0x0000275a start + 54 ) sharedlibrary apply-load-rules all
The Current Version in the system library is 2.6.
Any suggestions?
(1) When running python (/usr/bin/python) in Terminal I am able to
import objc successfully. I printed the directory to be sure it's
complete
Seamuss-MacBook:~ seamus$ /usr/bin/python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import objc print dir(objc) ['Accessor', 'BadPrototypeError', 'CFToObject', 'Category', 'FSRef',
'FSSpec', 'IBAction', 'IBOutlet', 'IMP', 'LockError',
'MAC_OS_X_VERSION_10_1', ......
(2) I restarted Xcode, did a "Clean all" and rebuilt the app, but I
got this dump
"Running…
2009-09-07 12:25:39.355 First_PyObjC[2796:a0f] mainFilePath is /Users/
seamus/Science/xcode exploration/Objc-programs/First_PyObjC/build/
Debug/First_PyObjC.app/Contents/Resources/main.py
2009-09-07 12:25:39.360 First_PyObjC[2796:a0f] pythonpath is (
"/Users/seamus/Science/xcode exploration/Objc-programs/
First_PyObjC/build/Debug/First_PyObjC.app/Contents/Resources",
"/Users/seamus/Science/xcode exploration/Objc-programs/
First_PyObjC/build/Debug/First_PyObjC.app/Contents/Resources/PyObjC",
"/System/Library/Frameworks/Python.framework/Versions/Current/
Extras/lib/python/"
)
Traceback (most recent call last):
File "/Users/seamus/Science/xcode exploration/Objc-programs/
First_PyObjC/build/Debug/First_PyObjC.app/Contents/Resources/main.py",
line 10, in
import objc
File "/System/Library/Frameworks/Python.framework/Versions/Current/
Extras/lib/python/PyObjC/objc/init.py", line 22, in
_update()
File "/System/Library/Frameworks/Python.framework/Versions/Current/
Extras/lib/python/PyObjC/objc/init.py", line 19, in _update
import _objc
ImportError: dlopen(/System/Library/Frameworks/Python.framework/
Versions/Current/Extras/lib/python/PyObjC/objc/_objc.so, 2): Symbol
not found: _PyType_Modified
Referenced from: /System/Library/Frameworks/Python.framework/
Versions/Current/Extras/lib/python/PyObjC/objc/_objc.so
Expected in: flat namespace
in /System/Library/Frameworks/Python.framework/Versions/Current/
Extras/lib/python/PyObjC/objc/_objc.so
2009-09-07 12:25:39.460 First_PyObjC[2796:a0f] *** Terminating app due
to uncaught exception 'NSInternalInconsistencyException', reason: '/
Users/seamus/Science/xcode exploration/Objc-programs/First_PyObjC/
main.m:46 main() PyRun_SimpleFile failed with file '/Users/seamus/
Science/xcode exploration/Objc-programs/First_PyObjC/build/Debug/
First_PyObjC.app/Contents/Resources/main.py'. See console for errors.'
*** Call stack at first throw:
(
0 CoreFoundation 0x90a1858a __raiseError + 410
1 libobjc.A.dylib 0x9309cf49
objc_exception_throw + 56
2 CoreFoundation 0x90a182b8 +[NSException
raise:format:arguments:] + 136
3 CoreFoundation 0x90a1822a +[NSException
raise:format:] + 58
4 First_PyObjC 0x00002bc2 main + 1084
5 First_PyObjC 0x0000275a start + 54
)
sharedlibrary apply-load-rules all"
It seems identical to the original problem.
(3) I wondered if there is something the PATH specifications that
caused things to be misdirected during the build, so I printed
sys.path out from within python.
/Library/Python/2.6/site-packages/pyobjc-2.2b2-py2.6.egg /Library/Python/2.6/site-packages/ pyobjc_framework_XgridFoundation-2.2b2-py2.6.egg /Library/Python/2.6/site-packages/pyobjc_framework_WebKit-2.2b2- py2.6.egg /Library/Python/2.6/site-packages/ pyobjc_framework_SystemConfiguration-2.2b2-py2.6-macosx-10.6- universal.egg /Library/Python/2.6/site-packages/pyobjc_framework_SyncServices-2.2b2- py2.6.egg /Library/Python/2.6/site-packages/pyobjc_framework_SearchKit-2.2b2- py2.6.egg /Library/Python/2.6/site-packages/pyobjc_framework_ScreenSaver-2.2b2- py2.6-macosx-10.6-universal.egg /Library/Frameworks/Python.framework/Versions/Current/bin /Library/Frameworks/Python.framework/Versions/2.6/bin /Library/Frameworks/Python.framework/Versions/3.0/bin /Library/Frameworks/Python.framework/Versions/2.4/bin /opt/local/bin /opt/local/sbin /sw/bin /sw/sbin /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/X11/bin /usr/X11R6/bin /System/Library/Frameworks/Python.framework/Versions/2.6/lib/ python26.zip /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ plat-mac /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/ python /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ lib-tk /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ lib-old /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ lib-dynload /Library/Python/2.6/site-packages /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/ python/PyObjC /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/ python/wx-2.8-mac-unicode
It seems redundant in places and includes paths to other versions of
python, but I can't see that there is a source for the problem there.
Is there anything else that might offer a clue?
Thanks
Seamus O'Shea University of Lethbridge, iCORE, Cybera (403) 315-2941 (403) 332-4545
On Sep 6, 2009, at Sun, Sep6, 6:10 , Ronald Oussoren wrote:
Ronald Oussoren <ronaldoussoren@mac.com> added the comment:
This seems to be a problem with Apple's copy of Python or with your machine.
Could you try the following:
- In terminal.app run /usr/bin/python
- Then use 'import objc' from Python's prompt.
- Does this work or does it give the same traceback (it works for me BTW).
If importing objc from Python's prompt works: Try to do a clean
build of the application in Xcode (use Clean All and then perform a build).
resolution: -> invalid
Python tracker <report@bugs.python.org> <http://bugs.python.org/issue6812>