2017-06-08 6 views
0

Ich habe Numpy 1.13.0 unter Windows 10 installiert; aber wenn ich versuche, den folgenden Code auszuführen, gibt es die obigen FehlerModuleNotFOundError: Kein Modul namens 'numpy.ma'; 'numpy' ist kein Paket

#!C:\Users\sukhpreet.singh\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit) 
import numpy as np 
import matplotlib.pyplot as pp 
a = np.array([1,2,3,4,5]) 
print(a.dtype) 

Im Folgenden sind die Details der Fehlermeldung:

Traceback (most recent call last): 
File "numpyy.py", line 4, in <module> 
import numpy as np 
File "C:\Users\sukhpreet.singh\Project\numpy.py", line 5, in <module> 
import matplotlib.pyplot as pp 
File "C:\Users\sukhpreet.singh\AppData\Local\Continuum\Anaconda3\lib\site-packages\matplotlib\__init__.py", line 122, in <module> 
from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label 
File "C:\Users\sukhpreet.singh\AppData\Local\Continuum\Anaconda3\lib\site-packages\matplotlib\cbook.py", line 33, in <module> 
import numpy.ma as ma 
ModuleNotFoundError: No module named 'numpy.ma'; 'numpy' is not a package 

Antwort

0

Sie haben auch ein Modul numpy auf Python-Suchpfad genannt (um C:\Users\sukhpreet.singh\Project\numpy.py).

Es überrascht nicht, wenn matplotlibnumpy.ma zu importieren versucht, es findet Ihrnumpy Modul, nicht das Bibliothekspaket.

Fazit: Benennen Sie Ihre Module nicht wie andere Pakete/Bibliotheken, die Sie verwenden möchten.

Verwandte Themen