[SciPy-dev] NumPy import problem.

Robert Kern robert.kern at gmail.com
Fri Jan 6 16:26:10 CST 2006


Fernando Perez wrote:
> Robert Kern wrote:
> 
>>Charles R Harris wrote:
>>
>>
>>>On 1/6/06, *Robert Kern* <robert.kern at gmail.com
>>><mailto:robert.kern at gmail.com>> wrote:
>>>
>>>   Charles R Harris wrote:
>>>   > If I try to import numpy from python in my home directory I get the
>>>   > following error
>>>
>>>   Do you have a module named "new" in your home directory?
>>>
>>>Why, yes I did. I renamed it and things work fine now. I deduce that
>>>this problem has been seen before?
>>
>>We've seen something similar once or twice before. When I get an error that says
>>some module doesn't have suchAndSuch attribute that really ought to be there, I
>>always check to make sure that the module I think is being imported is the
>>module that is actually being imported. The "new" module is somewhat notorious
>>for this kind of error.
> 
> This is precisely why pep-328, which I recently mentioned, is going to be at 
> some point enforced.  I've also been bitten more than once by this.

I'm not sure PEP 328 affects this case. The "new" module is in the standard
library, and Chuck's new.py file wasn't in a package. The problem would still
exist in a PEP-328 world, I think.

-- 
Robert Kern
robert.kern at gmail.com

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Scipy-dev mailing list