[Pythonmac-SIG] python make failing: "ImportError: No module named MacOS"
Hi all, i'm building a local instance of Python v2.4.1c2 on a 'virgin install' of fully-updated OSX 10.3.8. w/ XCode 1.5 'configure' is successful w/ ./configure \ --with-prefix=/usr/local/pythontest \ --enable-framework=/usr/local/pythonframe \ --with-threads \ --with-cxx=g++ \ --enable-ipv6 \ --enable-toolbox-glue but a subsequent make frameworkinstall FAILS at: /usr/bin/install -c -m 644 ./Mac/Tools/IDE/Wtraceback.py /usr/local/pythonframe/Python.framework/Versions/2.4/Mac/Tools/IDE /usr/bin/install -c -m 644 ./Mac/Tools/IDE/Wwindows.py /usr/local/pythonframe/Python.framework/Versions/2.4/Mac/Tools/IDE ./python.exe ./Mac/scripts/cachersrc.py -v /usr/local/pythonframe/Python.framework/Versions/2.4/lib/python2.4/plat-mac /usr/local/pythonframe/Python.framework/Versions/2.4/Mac/Tools Traceback (most recent call last): File "./Mac/scripts/cachersrc.py", line 7, in ? import macresource File "/Volumes/g4_PORTS/usr/ports/Python-2.4.1c2/Lib/plat-mac/macresource.py", line 6, in ? import MacOS ImportError: No module named MacOS make[1]: *** [installmacsubtree] Error 1 make: *** [frameworkinstallmaclib] Error 2 I've found limited prior reference to this "ImportError: No module named MacOS "), @: http://mail.python.org/pipermail/pythonmac-sig/2004-March/010709.html but, afaik, there was no resolution ... any suggestions as to what's broken here? thx! richard ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] python make failing: "ImportError: No module named MacOS"
hi bob, any suggestions as to what's broken here? Works here, with 2.4.1c1 anyway. but there have been no relevant changes that I know of. i dropeed back and tried it with c1 as well ... same prob 4 me. argh Most of the arguments you specify to configure are already on by default or have no effect. The --prefix argument has no effect, the symlinks are hardcoded to be installed to /usr/local/bin, and the framework contains everything else. well, that's particularly annoying ... then why offer the --prefix arg in the first place? just for NON-framework installs? I'm not totally sure that enable-toolbox-glue is on by default, but I think it is. I used it anyway: % mkdir -p ~/src/Python-2.4.1c1/_panther % cd ~/src/Python-2.4.1c1/_panther % ../configure \ --enable-toolbox-glue \ --enable-framework=/Users/bob/python-2.4.1c1/Frameworks % make % sudo make frameworkinstall worked fine for me. ok, so something's missing on my system ... which is particularly odd since its a clean/complete install. h anyone else, perhaps with ideas? or should i take this over the the dev list? cheers, richard ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] python make failing: "ImportError: No module named MacOS"
hi bob, then why offer the --prefix arg in the first place? just for NON-framework installs? Yes, --prefix is for non-framework installs. If you read the docs for frameworks, you'll see that it's only "lightly tested" with an alternate path. You may have more luck if you just use the defaults. The docs also say that you can move the framework later. ah ... anyone else, perhaps with ideas? or should i take this over the the dev list? I doubt there's anyone on dev that would be able to help you that isn't also subscribed here. fair nuf. always best to ask, i find ... cuz 'they' all get pretty ornery if ya don' belong ;-D You'll probably just have to wait, beer has been opened ... or dig deeper into the output of make to find out why MacOS isn't building, or isn't loading properly. yup. 1st gotta figure out 'what' MacOS 'is' ... I suspect that you may have some weird environment variables set, maybe PYTHONPATH empty maybe DYLD_*, etc. changes, but at the moment, % echo $DYLD_LIBRARY_PATH /usr/local/berkeley-db/lib: /usr/local/cyrus-sasl/lib: /usr/local/ssl/lib: /usr/local/lib: /System/Library/Frameworks: /usr/lib: /usr/X11R6/lib tried moving/removing the '/System/Library/Frameworks', to no avail ... You may also want to make sure that the MACOSX_DEPLOYMENT_TARGET environment variable is set to 10.3. The only thing I left out is that I have MACOSX_DEPLOYMENT_TARGET set to 10.3 in my rc. % echo $MACOSX_DEPLOYMENT_TARGET 10.3 Oh, and note that if you DO move the framework, you will need to run install_name_tool over it, the python executable, and possibly ALL of the extensions if MACOSX_DEPLOYMENT_TARGET was set to 10.2 (or maybe if not set at all, I haven't confirmed the default behavior when not set). this i need to remember ... thanks again. now to dig & wait =) richard ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] can't link Python 2.4.1 against external libxml2 ...
hi all, i've originally posted this on python-list -- but I have a suspicion my questions may have to do with Mac-specific issues, so I'll try here as well ... i've successfully built Python-2.4.1 from src on OSX 10.3.8 as a framework install with, simply: ./configure \ --enable-framework \ --with-threads \ --with-cxx=g++ \ --enable-ipv6 \ --enable-toolbox-glue make frameworkinstall i'm next attempting to build same but linking against an external instance of libxml2 (v2.6.18) installed in /usr/local ... i've tried the ususal combinations of setting LDFLAGS and/or assigning --with-libs (="/usr/local/lib/libxml2.2.6.18.dylib"), to no avail. no matter what i do, the build links against the 'native' /usr/lib/libxml* ... successful w/ no error, just the 'wrong' lib. wondering whether i had unusual path probs, i also tried mv'ing the native libs out of the way, so that the only instance of libxml* is found in /usr/local/lib, but then the make fails, complaining that /usr/lib/libxml* is not found. sigh. i'm fairly sure i'm missing something trivial here ... any suggestions/pointers as to how to link *my* libxml into the framework build? thanks! richard ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] can't link Python 2.4.1 against external libxml2 ...
hi bob, no matter what i do, the build links against the 'native' /usr/lib/libxml* ... successful w/ no error, just the 'wrong' lib. Neither Python itself, nor any extension in the standard library, links to libxml. well, that's good -- & at least consistent with why there's no significant reference to libxml in the src ... if that's the case, then it seems even more odd to me that the python build is sensitive to its presence & location ... as, What the heck are you talking about? simply the output of my python build's 'make' (well, 'make frameworkinstall', anyway ... ): but then the make fails, complaining that /usr/lib/libxml* is not found with 'native' libxml* mv'd from /usr/lib, % ls -al *xml* su: /usr/local/bin/ls: No match. and libxml2-2.6.18 installed in /usr/local/lib, % ls -al /usr/local/lib/*xml* -rwxr-xr-x 1 root staff 3038292 Apr 3 19:18 libxml2.2.6.18.dylib lrwxr-xr-x 1 root staff 20 Apr 3 19:18 libxml2.2.dylib -> libxml2.2.6.18.dylib -rw-r--r-- 1 root staff 3651384 Apr 3 19:18 libxml2.a lrwxr-xr-x 1 root staff 20 Apr 3 19:18 libxml2.dylib -> libxml2.2.6.18.dylib -rwxr-xr-x 1 root staff 848 Apr 3 19:18 libxml2.la -rw-r--r-- 1 root staff 228 Apr 3 19:18 xml2Conf.sh python 'make' dies with ... ... Mkdir ///Applications/MacPython-2.4 /bin/mkdir -p ///Applications/MacPython-2.4 StandaloneExecutable ///Applications/MacPython-2.4/PythonLauncher.app/Contents/MacOS/PythonLaunc her StandaloneExecutable.LinkUsingFileList ///Applications/MacPython-2.4/PythonLauncher.app/Contents/MacOS/PythonLaunc her gcc -o ///Applications/MacPython-2.4/PythonLauncher.app/Contents/MacOS/PythonL auncher "-L/Volumes/Projects/ports/Python-2.4.1/Mac/OSX/PythonLauncher/build" "-L/Volumes/Projects/ports/Python-2.4.1/Mac/OSX/PythonLauncher/build" "-F/Volumes/Projects/ports/Python-2.4.1/Mac/OSX/PythonLauncher/build" "-F/Volumes/Projects/ports/Python-2.4.1/Mac/OSX/PythonLauncher/build" -filelist /Volumes/Projects/ports/Python-2.4.1/Mac/OSX/PythonLauncher/build/Pytho nLauncher.build/PythonLauncher.build/Objects-normal/LinkFileList "-arch" "ppc" "-s" "-prebind" "-Wl,-no_arch_warnings" "-framework" "Cocoa" "-framework" "Carbon" ld: warning prebinding disabled because dependent library: /usr/lib/libz.1.dylib is not prebound ld: warning can't open dynamic library: /usr/lib/libxml2.2.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) ld: Undefined symbols: _xmlSAXUserParseMemory referenced from Foundation expected to be defined in /usr/lib/libxml2.2.dylib ...failed StandaloneExecutable.LinkUsingFileList ///Applications/MacPython-2.4/PythonLauncher.app/Contents/MacOS/PythonLaunc her ... ** BUILD FAILED ** make[1]: *** [install_PythonLauncher] Error 1 make: *** [frameworkinstallapps] Error 2 *something's* expecting libxml2 to be there ... richard ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] can't link Python 2.4.1 against external libxml2 ...
hi robert, *something's* expecting libxml2 to be there ... I'll bet that it's either Cocoa or Carbon. In that case, you definitely *don't* want it to use your own libxml2. makes possible sense in that there's a reference to 'Foundation', which given your suspicion, refers to the OSX FoundationClass(es)? I.e., Cocoa/Carbon? >>ld: Undefined symbols: >>_xmlSAXUserParseMemory referenced from Foundation expected to be >> defined in >>/usr/lib/libxml2.2.dylib thought i'd be very hard pressed to prove or disprove ... Leave it be. Which is certainly good advice if that IS the case ... yet I'm still a little foggy on the whole matter given Bob's earlier comment: either Python itself, nor any extension in the standard library, links to libxml. What the heck are you talking about? which, iiuc, would suggest no dependence whatsoever on libxml -- either direct or indirect via Cocoa/Carbon. so, again, Leave it be. seems to be good advice. what concerns me a bit is that 'other' apps i'm building depend on my *external* libxml, and will -- eventually -- 'touch' some Python, which will depend 'still' on the native (cocoa/carbon related) libxml ... Will this 'version incompatibility' come back to bite me in the ass? i simply dunno. short of understanding/resolving the libxml dependence i *am* seeing, I guess I'll just have to wait and see when i get there =) thx, richard ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] can't link Python 2.4.1 against external libxml2 ...
robert, Foundation is its own framework (see /System/Library/Frameworks) yup. which is implicitly linked in by Cocoa and Carbon. sigh. more to learn. =-) clearly time to unpack & actually read my new copy of Hillegass' book ... which, iiuc, would suggest no dependence whatsoever on libxml -- either direct or indirect via Cocoa/Carbon. No, he only meant directly, I'm sure. hmmm. ok. Always a good idea. Don't fix it until it breaks. And it probably won't. well, rats! so much for the 'pleasant aesthetics' of version consistency ;-) thx & cheers, richard ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig