Compile python extensions under windows/cygwin

Discussion in 'Python' started by Joana, May 24, 2009.

  1. Joana

    Joana Guest

    I mantain Python on Windows, all installed packages are under c:
    \Python25\Lib\site-packages. Now I have to build C libraries used by
    python extensions and I am using cygwin, but I don't know how to
    install the module in Windows directory.

    Can anyone help me?

    Thanks in advance

    Joana
     
    Joana, May 24, 2009
    #1
    1. Advertising

  2. Joana

    Joana Guest

    On 25 Maio, 00:13, Christian Heimes <> wrote:
    > Joana wrote:
    > > I mantain Python on Windows, all installed packages are under c:
    > > \Python25\Lib\site-packages. Now I have to build C libraries used by
    > > python extensions and I am using cygwin, but I don't know how to
    > > install the module in Windows directory.

    >
    > Are you sure you want to use Cygwin? Binaries build with and for Cygwin
    > are not compatible with ordinary Windows binaries. I assume that you
    > want to build C extensions with the open source MinGW32 compiler? That's
    > easy:
    >
    > * Install MinGW32
    > * Add its bin directory to PATH
    > * Add a file distutils.cfg in C:\Python25\Lib\distutils with
    >   this content:
    >
    > [build]
    > compiler=mingw32
    >
    > * Have fun :)
    >
    > Christian


    hmm.. but the problem with mingw32 is that it does not have the
    libraries I need. The module I want to install includes netinet/in.h.
    So the answer is that I can't install that module in Windows?
     
    Joana, May 25, 2009
    #2
    1. Advertising

  3. Joana

    David Lyon Guest

    On Sun, 24 May 2009 15:34:42 -0700 (PDT), Joana <>
    wrote:
    > I mantain Python on Windows, all installed packages are under c:
    > \Python25\Lib\site-packages. Now I have to build C libraries used by
    > python extensions and I am using cygwin, but I don't know how to
    > install the module in Windows directory.
    >
    > Can anyone help me?


    I think it is a problem because as far as I know cygwin cannot
    see files outside of /cygwin.

    Where is python installed in cygwin?

    Can't you install the same packages into cygwin?

    and then do your building in there...?

    David
     
    David Lyon, May 25, 2009
    #3
  4. Joana

    Guest

    On May 25, 9:42 am, David Lyon <> wrote:
    > On Sun, 24 May 2009 15:34:42 -0700 (PDT), Joana <>
    > wrote:
    >
    > > I mantain Python on Windows, all installed packages are under c:
    > > \Python25\Lib\site-packages. Now I have to build C libraries used by
    > > python extensions and I am using cygwin, but I don't know how to
    > > install the module in Windows directory.

    >
    > > Can anyone help me?

    >
    > I think it is a problem because as far as I know cygwin cannot
    > see files outside of /cygwin.
    >
    > Where is python installed in cygwin?
    >
    > Can't you install the same packages into cygwin?
    >
    > and then do your building in there...?
    >
    > David


    I think I don't understand this comment.

    All the drives on my windows machine are visible using the scheme:

    /cygdrive/<drivename>/<path>/<to>/<file>

    For example:

    bash-3.2$ ls -l /cygdrive/c/windows/system32/drivers/etc/hosts
    -rwx------+ 1 johnbre mkgroup-l-d 820 Nov 8 2008 /cygdrive/c/windows/
    system32/drivers/etc/hosts
    bash-3.2$

    and you can mount things in cygwin as you choose:

    http://www.cygwin.com/cygwin-ug-net/using.html#mount-table

    The answer to the problem of compiling python packages was:

    * Download Visual C++ 2008 Express for free from Microsoft.
    * Find it was incompatible with compiling packages for my Python 2.5
    (Visual Studio 2003).
    * Move to Python 2.6.
    * Problem solved, things compiled and worked
     
    , May 25, 2009
    #4
  5. Joshua Kugler, May 26, 2009
    #5
    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. Zhuanshi He
    Replies:
    0
    Views:
    323
    Zhuanshi He
    Apr 17, 2005
  2. Zhuanshi He
    Replies:
    1
    Views:
    359
    Jason Tishler
    Apr 19, 2005
  3. peter
    Replies:
    0
    Views:
    725
    peter
    May 12, 2005
  4. KB
    Replies:
    4
    Views:
    1,199
  5. Guest
    Replies:
    1
    Views:
    261
    Peter Notebaert
    Nov 5, 2005
Loading...

Share This Page