Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > building python extensions with .net sdk compiler?

Reply
Thread Tools

building python extensions with .net sdk compiler?

 
 
Anthony Baxter
Guest
Posts: n/a
 
      11-17-2003

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 <(E-Mail Removed)>
It's never too late to have a happy childhood.


 
Reply With Quote
 
 
 
 
Zuurcool
Guest
Posts: n/a
 
      12-10-2004
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.
 
Reply With Quote
 
 
 
 
Grumman
Guest
Posts: n/a
 
      12-11-2004
> 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.
 
Reply With Quote
 
David Fraser
Guest
Posts: n/a
 
      12-11-2004
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
 
Reply With Quote
 
Grumman
Guest
Posts: n/a
 
      12-11-2004
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.


 
Reply With Quote
 
Mike C. Fletcher
Guest
Posts: n/a
 
      12-11-2004
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

 
Reply With Quote
 
Nick Coghlan
Guest
Posts: n/a
 
      12-12-2004
Mike C. Fletcher wrote:
> Which is what the patch here:
> http://www.vrplumber.com/programming/mstoolkit/
> does.


Has that patch been posted to Python's SourceForge patch tracker? I think the
distutils folks will be interested.

Cheers,
Nick.

--
Nick Coghlan | http://www.velocityreviews.com/forums/(E-Mail Removed) | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
 
Reply With Quote
 
Grumman
Guest
Posts: n/a
 
      12-12-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building extensions for python 2.6 adm64 with the SDK compiler David Cournapeau Python 0 12-12-2008 10:37 AM
Compiling Ruby + Extensions under the 'Windows SDK' James Tucker Ruby 0 05-27-2007 05:46 PM
troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK bhochstetler@gmail.com Python 8 04-11-2007 10:45 PM
The .NET Framework SDK needs to be installed before building vj Python 1 09-23-2005 02:22 AM
building Python extensions with XCode Benjamin Golinvaux Python 0 04-11-2004 01:21 PM



Advertisments