Compile python extensions under windows/cygwin

J

Joana

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
 
J

Joana

Joana said:
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?
 
D

David Lyon

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
 
B

brendan.johnston

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top