Question

I am running a windows machine have installed Python 2.5. I also used the windows installer to install NumPy.

This all works great when I run the Python (command line) tool that comes with Python.

However, if I run cygwin and then run Python from within, it cannot find the numpy package.

What environment variable do I need to set? What value should it be set to?

Was it helpful?

Solution

Cygwin comes with its own version of Python, so it's likely that you have two Python installs on your system; one that installed under Windows and one which came with Cygwin.

To test this, try opening a bash prompt in Cygwin and typing which python to see where the Python executable is located. If it says /cygdrive/c/Python25/python.exe or something similar then you'll know you're running the Windows executable. If you see /usr/local/bin/python or something like that, then you'll know that you're running the Cygwin version.

I recommend opening a DOS prompt and running Python from there when you need interactive usage. This will keep your two Python installs nicely separate (it can be very useful to have both; I do this on my own machine). Also, you may have some problems running a program designed for Windows interactive console use from within a Cygwin shell.

OTHER TIPS

You're running a separate copy of python provided by cygwin.

You can run /cygdrive/c/python25/python (or wherever you installed it) to get your win32 one, or just install another copy of numpy.

numpy built for windows is not compatible with cygwin python. You have to build it by yourself on cygwin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top