NameError und ModuleNotFoundError

Probleme bei der Installation?
Antworten
WeylandYutani
User
Beiträge: 3
Registriert: Mittwoch 3. Januar 2018, 11:48

hallo,

ich bin python-anfänger und arbeite gerade mit dem buch https://www.amazon.com/Scientific-Compu ... 1786463512, zu dem es auch auf github https://github.com/PacktPublishing/Scie ... h-Python-3 zugehörigen code gibt.

wenn ich https://github.com/PacktPublishing/Scie ... icTypes.py in pycharm ausführen möchte, insbesondere:

Code: Alles auswählen

from scipy import *
from matplotlib.pyplot import *
get_ipython().magic('matplotlib inline')
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
erhalte ich

Code: Alles auswählen

NameError: name 'get_ipython' is not defined
obwohl ich unter "Project Interpreter" ipython als auch matplotlib installiert habe.

Bild

das gleiche script gibt es auch als jupyter-notebook https://github.com/PacktPublishing/Scie ... ypes.ipynb, wenn ich das ausführe, kommt:

Code: Alles auswählen

ModuleNotFoundError: No module named 'matplotlib'
kann mir jemand bei meinem problem helfen? gruß, michael
Sirius3
User
Beiträge: 17711
Registriert: Sonntag 21. Oktober 2012, 17:20

@WeylandYutani: da es sich um Jupyter-Notebooks handelt, kann man sie nicht in PyCharm ausführen. Und Deine Jupyter-Installation scheint nicht das gleiche Python zu benutzen wie PyCharm, wenn dort matplotlib nicht instaliert ist.
Antworten