[Numpy-discussion] Problems with numpy

Mustapha BOUIKHIF mustapha.bouikhif@idris...
Thu Feb 24 10:35:36 CST 2011


Benjamin,

I am not in numpy install dir and have the error however:

#python
Python 2.6 (r26:66714, Nov  9 2010, 01:31:57)
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import os
 >>> os.getcwd()
*'/home/idris/cos/scos190'*
 >>> import numpy
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py", 
line 127, in <module>
     raise ImportError(msg)
ImportError: Error importing numpy: you should not try to import numpy 
from its source directory; please exit the numpy source tree, and 
relaunch your python intepreter from there.


Benjamin Root wrote:
> 
> 
> On Thu, Feb 24, 2011 at 10:04 AM, Mustapha BOUIKHIF 
> <mustapha.bouikhif@idris.fr <mailto:mustapha.bouikhif@idris.fr>> wrote:
> 
>     Hello all,
> 
>     I am having problems with numpy (version 1.5.1)
> 
>     when executing this command as root, evry thing is OK:
>     python -Wd -c 'import numpy; numpy.test()'
> 
>     Running unit tests for numpy
>     NumPy version 1.5.1
>     NumPy is installed in /usr/local/lib64/python2.6/site-packages/numpy
>     Python version 2.6 (r26:66714, Nov  9 2010, 01:31:57) [GCC 4.3.4
>     [gcc-4_3-branch revision 152973]]
>     nose version 1.0.0
> 
>     ......................
>     Ran 3006 tests in 14.088s
> 
>     OK (KNOWNFAIL=4)
> 
>     But as a normal user (non root), the same command show errors:
> 
>     python -Wd -c 'import numpy; numpy.test()'
>     Traceback (most recent call last):
>       File "<string>", line 1, in <module>
>       File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py",
>     line 127, in <module>
>         raise ImportError(msg)
>     ImportError: Error importing numpy: you should not try to import numpy
>     from its source directory; please exit the numpy source tree, and
>     relaunch your python intepreter from there.
> 
> 
>     Python 2.6
>     Linux  <machine> 2.6.32.27-0.2-default  x86_64 x86_64 x86_64 GNU/Linux
>     modules are in /usr/local/lib64/python2.6/site-packages/
> 
>     Any help will be appreciated.
> 
> 
> 
> Mustapha,
> 
> "ImportError: Error importing numpy: you should not try to import numpy
> from its source directory; please exit the numpy source tree, and
> relaunch your python intepreter from there."
> 
> It is generally a bad idea to import installed modules directly from 
> their source directory.  Just change your working directory to another 
> location where "numpy" is not a directory, and you should be able to run 
> the tests.
> 
> Ben Root
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion


-- 
Cordialement

Mustapha Bouikhif
CNRS - IDRIS

Tel: +33 1 69 35 85 27
Fax: +33 1 69 35 37 75
E-mail: mustapha.bouikhif@idris.fr
http://www.idris.fr


More information about the NumPy-Discussion mailing list