I'm using numpy 1.6.1, scipy 0.10.1, mac OS X 10.6.8.
Can anyone help me understand the following error?
$ ~/virtual-python/bin/python -c "import scipy, scipy.interpolate"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/adam/virtual-python/lib/python2.7/site-packages/scipy/interpolate/__init__.py",
line 156, in <module>
from ndgriddata import *
File "/Users/adam/virtual-python/lib/python2.7/site-packages/scipy/interpolate/ndgriddata.py",
line 9, in <module>
from interpnd import LinearNDInterpolator, NDInterpolatorBase, \
File "numpy.pxd", line 174, in init interpnd
(scipy/interpolate/interpnd.c:7771)
ValueError: numpy.ndarray has the wrong size, try recompiling
Thanks,
--
Adam Ginsburg
Graduate Student
Center for Astrophysics and Space Astronomy
University of Colorado at Boulder
http://casa.colorado.edu/~ginsbura/
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
My guess is that the numpy headers that were used during the compilation
of scipy do no correspond to the numpy that is being imported when you
are trying to import scipy. In other words, your compilation environment
doesn't match well your run time environment.
HTH,
Gael
On Mar 8, 2:09 pm, Gael Varoquaux <gael.varoqu...@normalesup.org>
wrote:
> SciPy-U...@scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user
It should be the one that is imported by Python when you type 'import
numpy'. Basically, in scipy's 'setup.py', the header are found using the
'numpy.get_include_folder()' function.
Gaël
(clarification: it's numpy.get_include(), not
numpy.get_include_folder(), I think)
On Mar 8, 3:01 pm, Gael Varoquaux <gael.varoqu...@normalesup.org>
wrote:
> On Thu, Mar 08, 2012 at 01:59:44PM -0800, Keflavich wrote:
> > That's plausible. How do I specify which numpy is used when compiling
> > scipy?
>
> It should be the one that is imported by Python when you type 'import
> numpy'. Basically, in scipy's 'setup.py', the header are found using the
> 'numpy.get_include_folder()' function.
>
> Gaël
> _______________________________________________
> SciPy-User mailing list
> SciPy-U...@scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user
Well, good job on persisting: half a dozen rebuild is too much :). Do you
have an idea what finally made the difference?
> (clarification: it's numpy.get_include(), not
> numpy.get_include_folder(), I think)
Good point, I was writing this email in a rush, without checking my
facts.
Gael
> On Mar 8, 3:01 pm, Gael Varoquaux <gael.varoqu...@normalesup.org>
> wrote:
> > On Thu, Mar 08, 2012 at 01:59:44PM -0800, Keflavich wrote:
> > > That's plausible. How do I specify which numpy is used when compiling
> > > scipy?
> > It should be the one that is imported by Python when you type 'import
> > numpy'. Basically, in scipy's 'setup.py', the header are found using the
> > 'numpy.get_include_folder()' function.
> > Gaël
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-U...@scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user
> _______________________________________________
> SciPy-User mailing list
> SciPy...@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
--
Gael Varoquaux
Researcher, INRIA Parietal
Laboratoire de Neuro-Imagerie Assistee par Ordinateur
NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France
Phone: ++ 33-1-69-08-79-68
http://gael-varoquaux.info
They're largely based on hyperjeff's, although his
sudo mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy \
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpyX
is evil and unnecessary if you pass --no-site-packages to mkvirtualenv.
I'm still on SciPy 0.9.0, but I don't have any trouble importing scipy.interpolate.
My eventual successful build looked like this:
numpy:
CFLAGS="-arch i386 -arch x86_64" FFLAGS="-m32 -m64" LDFLAGS="-Wall -
undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
MACOSX_DEPLOYMENT_TARGET=10.6 PYTHONPATH="/Library/Frameworks/
Python.framework/Versions/2.7/lib/python2.7/site-packages/" ~/virtual-
python/bin/python2.7 setup.py build --fcompiler=gnu95
scipy:
CFLAGS="-arch i386 -arch x86_64" FFLAGS="-m32 -m64" LDFLAGS="-Wall -
undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
MACOSX_DEPLOYMENT_TARGET=10.6 PYTHONPATH="/Users/adam/virtual-python/
lib/python2.7/site-packages/" ~/virtual-python/bin/python2.7 setup.py
build --fcompiler=gnu95
Re: Jonathan - good to know. I don't think that affected me, though,
as I made my virtualenv from a /Library python, not a /System/Library
python. Why evil, though?
Indeed, you story confirms my experience: a lot of build problem are
related to having several installs of Python, and having a hard time
controlling which one exactly is used when.
I don't know a good solution to these problems :(.
G
> Re: Jonathan - good to know. I don't think that affected me, though,
> as I made my virtualenv from a /Library python, not a /System/Library
> python. Why evil, though?
Because /System belongs to Apple and should not be tampered with. Using mkvirtualenv --no-site-packages means you don't have to. It doesn't matter how stale Apple's packages are; they get to have what they expect and you get to use what you want/need.