[SciPy-user] Bundling numpy/scipy with applications
Sat Dec 29 21:08:55 CST 2007
On Nov 13, 2007 12:35 AM, David Cournapeau <email@example.com> wrote:
> Johann Cohen-Tanugi wrote:
> > do make install in platform/numpy fails exactly in the same way :
> I forgot to tell you to do make clean before, otherwise, it indeed has
> no way to fail in a different way :)
> > [cohen@localhost numpy]$ make install
> > [===== NOW BUILDING: numpy-220.127.116.11 =====]
> > [fetch] complete for numpy.
> > [checksum] complete for numpy.
> > [extract] complete for numpy.
> > [patch] complete for numpy.
> > # Change default path when looking for libs to fake dir,
> > # so we can set everything by env variables
> > cd work/main.d/numpy-18.104.22.168 &&
> > PYTHONPATH=/home/cohen/garnumpyinstall/lib/python2.5/site-packages:/home/cohen/garnumpyinstall/lib/python2.5/site-packages/gtk-2.0
> > /usr/bin/python \
> > setup.py config_fc --fcompiler=gnu config
> > Traceback (most recent call last):
> > File "setup.py", line 90, in <module>
> > setup_package()
> > File "setup.py", line 60, in setup_package
> > from numpy.distutils.core import setup
> > File
> > "/data1/sources/python/garnumpy-0.4/platform/numpy/work/main.d/numpy-22.214.171.124/numpy/__init__.py",
> > line 39, in <module>
> > import core
> > File
> > "/data1/sources/python/garnumpy-0.4/platform/numpy/work/main.d/numpy-126.96.36.199/numpy/core/__init__.py",
> > line 8, in <module>
> > import numerictypes as nt
> > File
> > "/data1/sources/python/garnumpy-0.4/platform/numpy/work/main.d/numpy-188.8.131.52/numpy/core/numerictypes.py",
> > line 83, in <module>
> > from numpy.core.multiarray import typeinfo, ndarray, array, empty, dtype
> > ImportError: No module named multiarray
> I really don't understand this error: you are configuring numpy for
> compilation, so it should not try to import numpy.core (which has no way
> to succeed since it is not built yet). IOW, it is a bootstrap error
> (numpy build system tries to import numpy).
We finally tracked this down to a system-wide numpy confusing the
brittle hack that __init__ was using to detect being run from the
Fixes it and allows you to do an in-place build of numpy via
python setup.py build_src --inplace
python setup.py build_ext --inplace
It's a bit of an ugly hack, but at least it works robustly and avoids
the problem above (which bit me today).
Please let me know if the approach in the patch causes problems for
any other types of usage.
More information about the SciPy-user