[SciPy-dev] Running tests outside site-packages (was: Re: numpy-0.9.2, scipy-0.4.4 RPMs)

Pearu Peterson pearu at scipy.org
Fri Jan 20 01:43:55 CST 2006

On Fri, 20 Jan 2006, Ignacio Vazquez-Abrams wrote:

> I'm trying to write the %check section of the numpy spec file and I keep
> running into the following:
> + /usr/bin/python -c 'import numpy ; numpy.test(1, 1)'
> numpy/__init__.py:47: UserWarning: Module numpy was already imported
> from numpy/__init__.pyc,
> but /home/ignacio/work/rpmbuild/BUILD/numpy-0.9.2 is being added to
> sys.path
>  import pkg_resources as _pk # activate namespace packages (manipulates
> __path__)
> Running from numpy source directory.

> Traceback (most recent call last):
>  File "<string>", line 1, in ?
> AttributeError: 'module' object has no attribute 'test'
> How can I get the tests to run?

Make sure that numpy is not imported from source directory, see ^^^^ 
above. Check sys.path and may be you need to remove source directory from 
sys.path before importing numpy. Hmm, maybe something like

   /usr/bin/python -c 'import pkg_resources,numpy; ...'

will work?


More information about the Scipy-dev mailing list