Hello I'm working with cygwin 1.7.9. I've installed python 2.6 from the cygwin distro. I've also installed nympy from the distro (v. 1.4.1), and when that failed, I tried to installed directly form source (v. 1.5.1) In both cases when I try to run a script that imports numpy (including running the numpy tests) I get the following error message: --
import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/site-packages/numpy/__init__.py", line 154, in <modul e> import ctypeslib File "/usr/lib/python2.6/site-packages/numpy/ctypeslib.py", line 60, in <modul e> import ctypes File "/usr/lib/python2.6/ctypes/__init__.py", line 439, in <module> pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) OSError: No such file or directory
Any ideas? Thanx Gaby Please consider the environment before printing this email. NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.
On Tue, Apr 12, 2011 at 10:25 AM, Gabriella Turek <g.turek@niwa.co.nz> wrote:
Hello I'm working with cygwin 1.7.9. I've installed python 2.6 from the cygwin distro. I've also installed nympy from the distro (v. 1.4.1), and when that failed, I tried to installed directly form source (v. 1.5.1) In both cases when I try to run a script that imports numpy (including running the numpy tests) I get the following error message:
It seems ctypes import fails. Are you sure that your python is correctly installed ? What does the following does: python -c "import ctypes" If that does not work, the problem is how python was installed, not with numpy. cheers, David
On Tue, Apr 12, 2011 at 9:17 AM, David Cournapeau <cournape@gmail.com> wrote:
On Tue, Apr 12, 2011 at 10:25 AM, Gabriella Turek <g.turek@niwa.co.nz> wrote:
Hello I'm working with cygwin 1.7.9. I've installed python 2.6 from the cygwin distro. I've also installed nympy from the distro (v. 1.4.1), and when that failed, I tried to installed directly form source (v. 1.5.1) In both cases when I try to run a script that imports numpy (including running the numpy tests) I get the following error message:
It seems ctypes import fails. Are you sure that your python is correctly installed ? What does the following does:
python -c "import ctypes"
If that does not work, the problem is how python was installed, not with numpy.
It's a known problem that ctypes is not always built for Python, see for example http://projects.scipy.org/numpy/ticket/1475 http://bugs.python.org/issue1516 http://bugs.python.org/issue2401 Also this ticket (ctypes + Cygwin) may be related: http://projects.scipy.org/numpy/ticket/904 The submitter of #1475 suggests that it's worth considering if numpy should depend on ctypes. I agree that it would be better not to. Ctypes is not in the Python 2.4 stdlib, and even after that can give problems on anything that's not Linux. Would it be possible to use Cython instead with a reasonable amount of effort? Ralf
participants (3)
-
David Cournapeau
-
Gabriella Turek
-
Ralf Gommers