building python extensions with .net sdk compiler?

Discussion in 'Python' started by Anthony Baxter, Nov 17, 2003.

  1. I'm trying to build a binary of fastaudio (the wrapper for the PortAudio
    library, from http://www.freenet.org.nz/python/pyPortAudio/) for Python 2.3.
    There's a lot of FAQs and the like out there that give some simple directions,
    involving fetching the .net sdk from MSDN and distutils "should work" -
    however, when I follow them and try to do the setup.py build step, I get
    a message:
    error: Python was built with version 6 of Visual Studio, and extensions need
    to be built with the same version of the compiler, but it isn't installed.

    Argh. All I want is a simple way to say 'give me a binary object that I can
    drop into my site-packages directory'. Is there a way, or am I screwed?

    Anthony

    --
    Anthony Baxter <>
    It's never too late to have a happy childhood.
     
    Anthony Baxter, Nov 17, 2003
    #1
    1. Advertising

  2. Anthony Baxter

    Zuurcool Guest

    Anthony Baxter wrote:
    > I'm trying to build a binary of fastaudio (the wrapper for the PortAudio
    > library, from http://www.freenet.org.nz/python/pyPortAudio/) for Python 2.3.
    > There's a lot of FAQs and the like out there that give some simple directions,
    > involving fetching the .net sdk from MSDN and distutils "should work" -
    > however, when I follow them and try to do the setup.py build step, I get
    > a message:
    > error: Python was built with version 6 of Visual Studio, and extensions need
    > to be built with the same version of the compiler, but it isn't installed.


    Hello Anthony,

    I got this insane message, how did you solve this "problem" ?

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

    Or does anyone know why i get this message, the .net sdk is about 100Mb,
    no fun !

    Zuurcool.
     
    Zuurcool, Dec 10, 2004
    #2
    1. Advertising

  3. Anthony Baxter

    Grumman Guest

    > I got this insane message, how did you solve this "problem" ?
    >
    > ------------
    > running install
    > running build
    > running build_py
    > running build_ext
    > error: The .NET Framework SDK needs to be installed before building
    > extensions for Python.
    > -------------
    >
    > Or does anyone know why i get this message, the .net sdk is about 100Mb,
    > no fun !


    The message says what it says. You have to install the .net SDK to use
    this. You'll also need the Platform SDK if you don't have it already
    installed. (And its a *lot* bigger than the .net sdk)

    And then you'll find out that you either need to hack
    distutils/msvccompiler.py, or your registry.
     
    Grumman, Dec 11, 2004
    #3
  4. Anthony Baxter

    David Fraser Guest

    Grumman wrote:
    >> I got this insane message, how did you solve this "problem" ?
    >>
    >> ------------
    >> running install
    >> running build
    >> running build_py
    >> running build_ext
    >> error: The .NET Framework SDK needs to be installed before building
    >> extensions for Python.
    >> -------------
    >>
    >> Or does anyone know why i get this message, the .net sdk is about
    >> 100Mb, no fun !

    >
    >
    > The message says what it says. You have to install the .net SDK to use
    > this. You'll also need the Platform SDK if you don't have it already
    > installed. (And its a *lot* bigger than the .net sdk)
    >
    > And then you'll find out that you either need to hack
    > distutils/msvccompiler.py, or your registry.


    So using MinGW seems like the better option ... is it working for Python
    2.4?

    David
     
    David Fraser, Dec 11, 2004
    #4
  5. Anthony Baxter

    Grumman Guest

    David Fraser wrote:
    >
    > So using MinGW seems like the better option ... is it working for Python
    > 2.4?


    Yes it does. :) I haven't tried it, but probably.

    The problem with the toolkit is that mscvccompiler.py in distutils is
    expecting VisualStudio to be installed, not the toolkit. So when it goes
    to lookup paths to the installed tools, it doesn't find them.

    All that's actually needed to make it work (After installing all 4
    required packages) is to add several strings to your registry. You'll
    probably have to add all the keys below \Software\Microsoft as well.

    Under :
    HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories

    You need to add the strings:
    "Include Dirs"(path to toolkit \include; path to platform sdk \include)
    "Library Dirs"(path to toolkit \lib; path to platform sdk \lib)
    "Path Dirs" (path to toolkit \bin; path to platform sdk \bin)

    And it'll be happy.

    Of course it'd be nice if msvccompiler.py just fell back to looking for
    the toolkit/sdk default dirs (or looked them up via environment vars,
    since the toolkit does include a vcvars32.bat that sets appropriate
    ones) if the VS lookup failed.
     
    Grumman, Dec 11, 2004
    #5
  6. Grumman wrote:

    > David Fraser wrote:
    >
    >>
    >> So using MinGW seems like the better option ... is it working for
    >> Python 2.4?

    >

    ....

    > Of course it'd be nice if msvccompiler.py just fell back to looking
    > for the toolkit/sdk default dirs (or looked them up via environment
    > vars, since the toolkit does include a vcvars32.bat that sets
    > appropriate ones) if the VS lookup failed.


    Which is what the patch here:
    http://www.vrplumber.com/programming/mstoolkit/
    does.

    Have fun,
    Mike

    ________________________________________________
    Mike C. Fletcher
    Designer, VR Plumber, Coder
    http://www.vrplumber.com
    http://blog.vrplumber.com
     
    Mike C. Fletcher, Dec 11, 2004
    #6
  7. Anthony Baxter

    Nick Coghlan Guest

    Nick Coghlan, Dec 12, 2004
    #7
  8. Anthony Baxter

    Grumman Guest

    Mike C. Fletcher wrote:
    > Grumman wrote:
    >> Of course it'd be nice if msvccompiler.py just fell back to looking
    >> for the toolkit/sdk default dirs (or looked them up via environment
    >> vars, since the toolkit does include a vcvars32.bat that sets
    >> appropriate ones) if the VS lookup failed.

    >
    >
    > Which is what the patch here:
    > http://www.vrplumber.com/programming/mstoolkit/
    > does.
    >


    Looks like you beat me to it. :)
     
    Grumman, Dec 12, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike C. Fletcher
    Replies:
    6
    Views:
    361
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Jul 30, 2004
  2. vj
    Replies:
    1
    Views:
    474
    Claudio Grondi
    Sep 23, 2005
  3. Replies:
    8
    Views:
    649
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 11, 2007
  4. David Cournapeau
    Replies:
    0
    Views:
    299
    David Cournapeau
    Dec 12, 2008
  5. James Tucker
    Replies:
    0
    Views:
    150
    James Tucker
    May 27, 2007
Loading...

Share This Page