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

Ignacio Vazquez-Abrams ivazquez at ivazquez.net
Sun Jan 22 10:37:17 EST 2006


On Fri, 2006-01-20 at 01:43 -0600, Pearu Peterson wrote:
> 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.

I'm not. I'm running it from the transient install directory the
rpmbuild uses. I don't know why Numpy thinks it's the source directory,
but it certainly isn't.

> Hmm, maybe something like
> 
>    /usr/bin/python -c 'import pkg_resources,numpy; ...'
> 
> will work?

No dice. It keeps numpy from complaining, but it doesn't cause it to
pull in the definition for test.

-- 
Ignacio Vazquez-Abrams <ivazquez at ivazquez.net>
http://fedora.ivazquez.net/

gpg --keyserver hkp://subkeys.pgp.net --recv-key 38028b72
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20060122/f3cf6fdb/attachment.sig>


More information about the SciPy-Dev mailing list