470,810 Members | 878 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

Using distutils in Windows XP / "Python in a Nutshell"

Following the directions in "Python in a Nutshell" (an excellent book),
I entered the C code for "helloworld.c", saved it as a file, and entered
this script and saved it as setup.py:

from distutils.core import setup, Extension
setup(name='helloworld', ext_modules= [
Extension('helloworld',sources=['helloworld.c'])])

Then, following directions, I type "python setup.py install" from a C:\>
prompt. I get these messages:

running install
running build
running build_ext
error: The .NET Framework SDK needs to be installed before building
extensions for Python.

....but the .NET Framework IS installed; the latest version, in fact, SDK
v2.0, part of the Visual Studio 2005 beta I've got. From poking around
the Internet it looks like I'm supposed to (a) monkey with my registry,
(b) install an OLD version of the SDK, (c) screw around with distutils
source code, or (d) switch to Linux. Nowhere do I find a clear solution
to my problem, though. Can anyone help? Should we submit an errata to
O'Reilly?
Apr 24 '06 #1
2 1328
Blair LeGent wrote:
error: The .NET Framework SDK needs to be installed before building
extensions for Python.

...but the .NET Framework IS installed


Just a guess, but is the C compiler in your PATH when you run python? I'm
assuming python on xp still uses environment variables and not some
windows-specific method for locating binaries.
Apr 24 '06 #2
Blair LeGent <bl******@ftml.net> wrote:
Following the directions in "Python in a Nutshell" (an excellent book),
Thanks!
I entered the C code for "helloworld.c", saved it as a file, and entered
this script and saved it as setup.py:

from distutils.core import setup, Extension
setup(name='helloworld', ext_modules= [
Extension('helloworld',sources=['helloworld.c'])])

Then, following directions, I type "python setup.py install" from a C:\>
prompt. I get these messages:

running install
running build
running build_ext
error: The .NET Framework SDK needs to be installed before building
extensions for Python.

...but the .NET Framework IS installed; the latest version, in fact, SDK
v2.0, part of the Visual Studio 2005 beta I've got. From poking around
the Internet it looks like I'm supposed to (a) monkey with my registry,
(b) install an OLD version of the SDK, (c) screw around with distutils
source code, or (d) switch to Linux. Nowhere do I find a clear solution
to my problem, though. Can anyone help? Should we submit an errata to
O'Reilly?


No need: the second edition (forthcoming!) does explain that the
compiler you need to build Python extensions (for 2.4 and 2.4) is VS
2003. I don't belabor on the hows and whys of VS2005 not being
supported -- I'm not into Windows (over the last few years) to grok them
fully. <http://www.vrplumber.com/programming/mstoolkit/> explains one
way to avoid shelling out $$$ to MS while still being able to build
Python extensions -- and just today I asked on this very group about
where to find VS 20003 Toolkit (it's not at its original location
indicated at the above URL, any more!) and was promptly answere with a
URL that worked just fine.
Alex
Apr 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Ravi | last post: by
5 posts views Thread by Giles Brown | last post: by
2 posts views Thread by marco | last post: by
7 posts views Thread by beliavsky | last post: by
14 posts views Thread by Paddy3118 | last post: by
11 posts views Thread by Wojciech Gryc | last post: by
41 posts views Thread by none | last post: by
92 posts views Thread by ureuffyrtu955 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.