のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

ImportError: Error importing numpy: you should not try to import numpy from its source directory

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.

How to import numpy in python shell

d:\Users\m_fujii\Downloads\numpy-1.8.0>python
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "numpy\__init__.py", line 143, 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.
>>>
>>> quit
Use quit() or Ctrl-Z plus Return to exit
>>> ^Z

ディレクトリを移動したら、エラーが消えた。

d:\Users\m_fujii\Downloads\numpy-1.8.0>cd ..
d:\Users\m_fujii\Downloads>cd ..
d:\Users\m_fujii>cd ..

d:\Users>python
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>