473,383 Members | 1,798 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,383 software developers and data experts.

HowTo Use Cython on a Windows XP Box?

August 31, 2007

I just downloaded the current Cython release and have no problem running
the cpython.py translator on the demo code. But when I try compiling, I
get an error complaining that my version of Python (which is the current
2.5.1 downloaded from python.org) was compiled with Visual C++ 2003. I
only have Visual C++ 2005 on my machine and am unable to find a download
of 2003 on the Microsoft site (no big surprise). I have never built
Python from source. Is it necessary or can someone suggest an alternative?

TIA

david lees
Sep 1 '07 #1
5 2561
On Aug 31, 9:06 pm, David Lees <debl2NoS...@verizon.netwrote:
August 31, 2007

I just downloaded the current Cython release and have no problem running
the cpython.py translator on the demo code. But when I try compiling, I
get an error complaining that my version of Python (which is the current
2.5.1 downloaded from python.org) was compiled with Visual C++ 2003. I
only have Visual C++ 2005 on my machine and am unable to find a download
of 2003 on the Microsoft site (no big surprise). I have never built
Python from source. Is it necessary or can someone suggest an alternative?

TIA

david lees
Unless you are customizing Python (and you can accomplish a *lot*
without doing so), it is not necessary to build Python from source.
Download one of the pre-built Windows binaries and install it, or get
the Win Python distribution from ActiveState and install that. Then
start writing your own Python demo scripts.

-- Paul

Sep 1 '07 #2
On Sep 1, 1:40 pm, Paul McGuire <pt...@austin.rr.comwrote:
On Aug 31, 9:06 pm, David Lees <debl2NoS...@verizon.netwrote:
August 31, 2007
I just downloaded the current Cython release and have no problem running
the cpython.py translator on the demo code. But when I try compiling, I
get an error complaining that my version of Python (which is the current
2.5.1 downloaded from python.org) was compiled with Visual C++ 2003. I
only have Visual C++ 2005 on my machine and am unable to find a download
of 2003 on the Microsoft site (no big surprise). I have never built
Python from source. Is it necessary or can someone suggest an alternative?
TIA
david lees

Unless you are customizing Python (and you can accomplish a *lot*
without doing so), it is not necessary to build Python from source.
Download one of the pre-built Windows binaries and install it, or get
the Win Python distribution from ActiveState and install that. Then
start writing your own Python demo scripts.
Paul, AFAICT the OP is referring not to CPython, but to Cython, which
is a Pyrex fork. See http://www.cython.org/

Building CPython from source is likely to be a red herring. The OP's
question appears to be "How do I, on Windows, compile C code generated
by Cython into a pyd that will play happily with the standard-issue
python.exe and python25.dll?", and is probably best directed to one of
the 3 forums mentioned on the above-referenced page.

HTH,
John


Sep 1 '07 #3
John Machin wrote:
On Sep 1, 1:40 pm, Paul McGuire <pt...@austin.rr.comwrote:
>On Aug 31, 9:06 pm, David Lees <debl2NoS...@verizon.netwrote:
>>August 31, 2007
I just downloaded the current Cython release and have no problem running
the cpython.py translator on the demo code. But when I try compiling, I
get an error complaining that my version of Python (which is the current
2.5.1 downloaded from python.org) was compiled with Visual C++ 2003. I
only have Visual C++ 2005 on my machine and am unable to find a download
of 2003 on the Microsoft site (no big surprise). I have never built
Python from source. Is it necessary or can someone suggest an alternative?
TIA
david lees
Unless you are customizing Python (and you can accomplish a *lot*
without doing so), it is not necessary to build Python from source.
Download one of the pre-built Windows binaries and install it, or get
the Win Python distribution from ActiveState and install that. Then
start writing your own Python demo scripts.

Paul, AFAICT the OP is referring not to CPython, but to Cython, which
is a Pyrex fork. See http://www.cython.org/

Building CPython from source is likely to be a red herring. The OP's
question appears to be "How do I, on Windows, compile C code generated
by Cython into a pyd that will play happily with the standard-issue
python.exe and python25.dll?", and is probably best directed to one of
the 3 forums mentioned on the above-referenced page.

HTH,
John

John,

Yes, you are correct in understanding my question. I thought my post
was clear, but I guess not. I will go try the pyrex list.
Sep 1 '07 #4
David Lees <de*********@verizon.netwrites:
Yes, you are correct in understanding my question. I thought my post
was clear, but I guess not. I will go try the pyrex list.
You might also try looking for references to distutils support for
non-MS compilers, since Pyrex (and presumably Cython) uses distutils
under the covers to build the final extension. I'm pretty sure there
is support in recent Python releases for using mingw rather than MSVC
for most extensions (there may be problems with using certain Python
APIs that depending on specific C RTL structures like files).

As to using VC, yes, it does have to be VC 7.1, e.g,. Visual Studio
2003. You can't use 2005, as MS didn't maintain runtime
compatibility. I'm sure there are a number of threads about that also
available. If I recall correctly, VC 7.1 began to be used in the 2.4
timeframe - although it was getting discussed back when 2.3 was
getting released, based on an offer Microsoft had made to provide
copies to core developers. The discussions are archived, but VC 6 was
definitely long in the tooth at that point. As the development tools
aren't free, they haven't been upgraded past that point to date. It's
unfortunate that when MS changed the main runtime DLL with VC 7 (for
the first time in a pretty long time), that they then did so
immediately again (and incompatibly) with VC 8.

At the time, there were also efforts with some success to use the free
toolkit MS made available (although I think it was sans optimizer),
but then I think that got pulled and/or it became more difficult to
find/use, but my memory is fuzzy.

You mention having VS 2005 - if so, do you also have an MSDN
subscription? I believe you should still be able to get VS 2003 via
that route if you first started with 2005 and thus never had 2003. If
not, the mingw approach may be your best bet.

-- David
Sep 1 '07 #5
On Sep 1, 12:13 am, John Machin <sjmac...@lexicon.netwrote:
On Sep 1, 1:40 pm, Paul McGuire <pt...@austin.rr.comwrote:


On Aug 31, 9:06 pm, David Lees <debl2NoS...@verizon.netwrote:
August 31, 2007
I just downloaded the current Cython release and have no problem running
the cpython.py translator on the demo code. But when I try compiling, I
get an error complaining that my version of Python (which is the current
2.5.1 downloaded from python.org) was compiled with Visual C++ 2003. I
only have Visual C++ 2005 on my machine and am unable to find a download
of 2003 on the Microsoft site (no big surprise). I have never built
Python from source. Is it necessary or can someone suggest an alternative?
TIA
david lees
Unless you are customizing Python (and you can accomplish a *lot*
without doing so), it is not necessary to build Python from source.
Download one of the pre-built Windows binaries and install it, or get
the Win Python distribution from ActiveState and install that. Then
start writing your own Python demo scripts.

Paul, AFAICT the OP is referring not to CPython, but to Cython, which
is a Pyrex fork. Seehttp://www.cython.org/

Building CPython from source is likely to be a red herring. The OP's
question appears to be "How do I, on Windows, compile C code generated
by Cython into a pyd that will play happily with the standard-issue
python.exe and python25.dll?", and is probably best directed to one of
the 3 forums mentioned on the above-referenced page.

HTH,
John- Hide quoted text -

- Show quoted text -
Thanks, I thought "Cython" was a typo of "CPython".

Glad the OP found a better-informed resource.

-- Paul

Sep 1 '07 #6

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

Similar topics

4
by: Josef Sachs | last post by:
Is Andrew Kuchling's regex-to-re HOWTO available anywhere? I've found the following (dead) links on various Web pages: http://py-howto.sourceforge.net/regex-to-re/regex-to-re.html...
4
by: Alexander Eisenhuth | last post by:
Hi alltogether, I use ActivePython 2.4.1 , also the debug part from http://ftp.activestate.com/ActivePython/etc/ and VC 6.0 unter Windows XP. I can't figure out howto debug my c++ extension....
3
by: Rolf Hemmerling | last post by:
Hello ! Beginner's question: Howto access .RC/.RES Ressource files with portable C++ code ( BCC,MSVC,GNU-C++, OpenWatcom) ? I just wanna access "local language strings", so that I may...
4
by: Digital Fart | last post by:
howto make a connection to database available in my classes. What is the best practice when i want to write classes that need a connection to the database? Do i make a conn variable in my...
0
by: Stefan Behnel | last post by:
Hi, just a quick announcement that I finished the port of the Cython compiler to the Py3 target platform. While you cannot currently run Cython itself in Py3, you can build the generated C...
1
by: martin.nordstrom87 | last post by:
Hi! I'm trying to wrap numpy with Cython and I've tried to use this guide to manage this: http://wiki.cython.org/WrappingNumpy However when I send an array to mysum() it gives me the right answer...
4
by: Tommy Grav | last post by:
I am trying to learn how to use cython, and while I am following the cython-dev mailing list I didn't feel like this question was totally appropriate for its audience so I am trying here first. ...
3
by: Larry Hale | last post by:
Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll...
1
by: Srijit Kumar Bhadra | last post by:
Cython Installation on Windows documentation (http://wiki.cython.org/ InstallingOnWindows) needs a minor but important change. Under section "MinGW Compiler" compiler = mingw32 should be...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.