[Numpy-discussion] building numpy/scipy

Robert Kern robert.kern@gmail....
Sat Jan 3 22:29:26 CST 2009

On Sat, Jan 3, 2009 at 22:20, Mike Landis <mlandis001@comcast.net> wrote:
> Josef (sorry about spelling your name wrong in a previous post),
> Thanks for the continued suggestions.  I deleted the site-packages:
> numpy and scipy, and reinstalled each using the current release
> superpacks (numpy first, then scipy).
> then I ran:
> python -c 'import numpy; numpy.test()'
> and got:
> Running unit tests for numpy
> NumPy version 1.2.1
> NumPy is installed in d::\Programs\Python25\lib\site-packages\numpy
> Python version 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) IMSC v.1310
> 32 bit (ntel)]
> nose version 0.10.4
> Traceback (most recent call last):
>   File "(string)", line 1, in <module>
>   File
> "d::\Programs\Python25\lib\site-packages\numpy\testing\nosetester.py",
> line 264, in test
>     import doctest
>   File"d:\Programs\Python25\lib\doctest.p", line 99, in <module>
>     import unittest, difflib, pd, tempfile
>   File "d:\programs\python25\lib\tempfile.py", line 33, in <module>
>     from random import Random as __Random
> ImportError: cannot import name Random

What directory are you in? I'm guessing that you are in a numpy/
directory either in the source tree or under site-packages/. Change
out of that directory. Python looks for modules in the current
directory before the standard locations, so it's picking up the
numpy.random subpackage instead of the standard library module random.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the Numpy-discussion mailing list