473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

building python extensions with .net sdk compiler?


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 <an*****@interlink.com.au>
It's never too late to have a happy childhood.
Jul 18 '05 #1
7 6375
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.
Jul 18 '05 #2
> 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.
Jul 18 '05 #3
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
Jul 18 '05 #4
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.
Jul 18 '05 #5
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

Jul 18 '05 #6
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 | nc******@email.com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
Jul 18 '05 #7
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. :)
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris Gonnerman | last post by:
I'll be quick. Here's a transcript: C:\usr\WConio-1.5>python setup.py build --compiler=mingw32 running build running build_py running build_ext building '_WConio' extension writing...
6
by: Mike C. Fletcher | last post by:
I've put together a page describing how to build Python 2.4 extensions with the free (as in beer, not libre) Microsoft Visual C++ Toolkit compiler. So far I've been able to build Numpy 23.1,...
1
by: TPJ | last post by:
Hello, I have another, probably stupid, question. I'm working on some Python project, and I use some extensions written in C. I do all the development on my GNU/Linux box, so my setup.py script...
6
by: JW | last post by:
I have a lousy little Python extension, generated with the generous help of Pyrex. In Linux, things are simple. I compile the extension, link it against some C stuff, and *poof*! everything...
3
by: Bo Peng | last post by:
Dear list, I have been using mingw to build a python extension module. I had to jump through a number of hooks like the _ctype problem caused by the use of msvcr71.dll, but the module was mostly...
1
by: Justin Johnson | last post by:
Hello, I'm trying to build Python 2.5.0 on AIX 5.3 using IBM's compiler (VisualAge C++ Professional / C for AIX Compiler, Version 6). I run configure and make, but makes fails with undefined...
4
by: vedrandekovic | last post by:
Hi, I have already install Microsoft visual studio .NET 2003 and MinGw, when I try to build a extension: python my_extension_setup.py build ( or install ) , I get an error: LINK : fatal...
3
by: kyosohma | last post by:
I am trying to figure out how to build binaries for Python packages and I've done it with MinGW. However, in my research, I've noticed that some of the programmers out there think that you should...
15
by: kyosohma | last post by:
Hi, I am trying to get a small group of volunteers together to create Windows binaries for any Python extension developer that needs them, much like the package/extension builders who volunteer...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.