Python extensions on Win32

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cliff Wells

    #1

    Python extensions on Win32

    For various sundry reasons, I find myself needing to deliver a
    Windows-based Python app. I also chose Python 2.5 for this platform.

    The app has several requirements, all of which are available for Python
    2.5/Win32 except one: pycurl. So I decided to try building the source
    but as it turns out, building C programs on Windows isn't nearly as
    straightforward as on Linux, so I'm a bit lost.

    I've downloaded the free Visual C++ Studio 2005, the pycurl sources (and
    the requisite curl libs, etc), but pycurl insists I don't have a C
    compiler compatible with VC++ 2003 (which I'm assuming is what Python
    2.5 is built with).

    So, for anyone who might know:

    1) Is VC++ 2005 compatible with VC++ 2003? If not, how can someone
    acquire VC++ 2003 (aside from thepiratebay.or g)? The Microsoft site
    seems to be a dead end here unless you've put out for a spendy MSDN
    subscription.

    2) If it is compatible, is there some specific incantation needed (env
    variables, etc) to make pycurl use it?

    3) If this is a dead-end, will mingw32 work instead (the error message
    from pycurl implies it might, but I have doubts)? Or will this only
    work with the cygwin version of Python?

    4) How much alcohol will be required to forget all this when I'm done?


    Thanks,
    Cliff

    --

  • Martin v. Löwis

    #2
    Re: Python extensions on Win32

    Cliff Wells schrieb:
    1) Is VC++ 2005 compatible with VC++ 2003?
    No. If you know very well how the extension module is written,
    and what precisely the incompatibiliti es are, you may get away
    with linking to msvcr8.dll, anyway.
    If not, how can someone
    acquire VC++ 2003 (aside from thepiratebay.or g)? The Microsoft site
    seems to be a dead end here unless you've put out for a spendy MSDN
    subscription.
    As you say, getting it from MSDN is one option; another is to get
    a used copy from Ebay. There used to be a free (as in beer) version
    of the compiler binaries; some people use that.
    2) If it is compatible, is there some specific incantation needed (env
    variables, etc) to make pycurl use it?
    If you set the environment variables MSSdk and DISTUTILS_USE_S DK,
    the distutils will use the compiler "cl.exe" in the PATH, regardless
    of whether the resulting binary would work.
    3) If this is a dead-end, will mingw32 work instead (the error message
    from pycurl implies it might, but I have doubts)? Or will this only
    work with the cygwin version of Python?
    No, the mingw binaries work fine with the pydotorg binaries of Python
    2.5.
    4) How much alcohol will be required to forget all this when I'm done?
    You shouldn't forget it. Instead, you should write your experience
    into "the Web", so that others have a flatter learning curve.

    Regards,
    Martin

    Comment

    • Steve Holden

      #3
      Re: Python extensions on Win32

      Martin v. Löwis wrote:
      Cliff Wells schrieb:
      [...]
      >>4) How much alcohol will be required to forget all this when I'm done?
      >
      >
      You shouldn't forget it. Instead, you should write your experience
      into "the Web", so that others have a flatter learning curve.
      >
      After which worthy effort I'll be happy to provide enough beer to erase
      the experience from your mind, at least temporarily. The other way to
      forget it is to turn 50 ...

      regards
      Steve
      --
      Steve Holden +44 150 684 7255 +1 800 494 3119
      Holden Web LLC/Ltd http://www.holdenweb.com
      Skype: holdenweb http://holdenweb.blogspot.com
      Recent Ramblings http://del.icio.us/steve.holden

      Comment

      Working...