[Pythonmac-SIG] PyXML 0.8.2 build error
Joel Rodrigues
borgempath@Phreaker.net
Sat, 22 Feb 2003 15:37:04 +0530
Thought I'd upgrade to PyXML 0.8.2 just now, and this it the
result. I was going to post anyway, but noticed it had already
come up, though with a less elegant solution.
The problem :
python setup.py build
Traceback (most recent call last):
File "setup.py", line 58, in ?
if sys.platform[:6] == "darwin" and \
NameError: name 'distutils' is not defined
The solution :
Changing the import statement at the top of setup.py from :
import sys, os, string
to this :
import sys, os, string, distutils
No errors thereafter, none of the
'extensions/expat/lib/xmltok.c:116: warning: `regparm' attribute
directive ignored' that John reported.
I'm on OS X v10.1.5. Python 2.2.2
- Joel
On Sunday, February 16, 2003, at 03:06 , John Miller wrote:
I just downloaded PyXML-0.8.2 and tried to install using the
directions in the README. However, the 'build' step failed
because of a NameError:
"""
[moire:/PyXML-0.8.2] jmillr% python setup.py build
Traceback (most recent call last):
File "setup.py", line 58, in ?
if sys.platform[:6] == "darwin" and \
NameError: name 'distutils' is not defined
"""
After finding the message below in the archives, I commented out
the entire four lines in setup.py (lines 58-61):
"""
#if sys.platform[:6] == "darwin" and \
#distutils.sysconfig.get_config_var("LDSHARED").find
("-flat_namespace") == -1:
# Mac OS X
#LDFLAGS.append('-flat_namespace')
"""
and installation proceeded to completion (albeit with many
warnings of the form):
extensions/expat/lib/xmltok.c:116: warning: `regparm' attribute
directive ignored
Anyway, it seems as though the PyXML distribution still has a
broken setup.py for MacOS X. I'm running OSX 10.2.4 with the
December 2002 Developer Tools and the stock 2.2 python.
John Miller
Technology Services
School of Education
University of Michigan
On Tue, 3 Sep 2002 21:51:58 -0400 W.T. Bridgman
<wtbridgman@radix.net> wrote:
Jack,
Got it!! :^)
The alternate user didn't work, nor did the single command line, but
the single command line commenting out the last -flat_namespace does!
In the setup.py in PyXML, there's a line:
if sys.platform[:6] == "darwin": # Mac OS X
LDFLAGS.append('-flat_namespace')
I commented out the LDFLAGS line and that seemed to clear the
problem. I suspect this was added at one time for PyXML but then was
later incorporated into the rest of the distutils package?
Looks like the rest of the build process worked as well.
Thanks for the pointer. How does one report this so it is fixed in
the next release?
Tom