をnumpyのをインポートするには、すべてのボディは、この問題で私を助けることができる:私はPythonでnumpyのを輸入しようとしたが、成功しませんでした:どのようにPythonシェルで
>>> import numpy as np
x=np.array([[7,8,5],[3,5,7]],np.int32)
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
import numpy as np
File "C:\Python27\lib\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.
私の作業ディレクトリを変更する方法。私はmatlabでそれを行う方法を知っているが、私はPythonの新しいユーザーであり、それを行う方法を知らない。 –
端末で、pythonを起動する前に、別のディレクトリにいることを確認してください。 numpyのフォルダがシステムのPYTHONPATH変数のどこかにある限り、システムのどこからでもPythonでnumpyをインポートできます。それが何を意味するのかわからない場合は、Google PYTHONPATHとPythonでインポートしてください。 – DaveTheScientist
私はこれを試みたが、didnt仕事; >>> os.getcwd() 'C:\\ Python27' >>> os.chdir( 'C:\ working directory') >>>インポートnumpy –