Ich versuche nur Tensorflow zu lernen, aber ich bin völlig neu für Python, also verwende ich Anaconda ich eine Conda Umgebung erstellt:Import: Kein Modul namens ‚matplotlib‘ - Verwendung von Anaconda tensorflow Umgebung
$ conda create −n tensorflow python =3.5
natürlich habe ich meine Conda Umgebung aktiviert
$ source activate tensorflow
Dann spielte ich ein wenig um in Spyder, versucht, eine MNIST stellige~~POS=HEADCOMP (copy-paste-Code von meinem Tutor, die mehrfach getestet wird) zu zeichnen, es enthält natürlich
import matplotlib.pyplot as plt
[...]
plt.plot(number)
aber die Python-Datei mit bash Ausführung gibt mir:
(tensorflow) [email protected]:~/ANNsCourse/Session1$ python helloWorld.py
Traceback (most recent call last):
File "helloWorld.py", line 10, in <module>
import matplotlib.pyplot as plt
ImportError: No module named 'matplotlib'
Ich bin ganz im Augenblick verwirrt, da die (tensorflow)
in der Bash offensichtlich, dass Umwelt meiner Conda tensorflow bezeichnet arbeitet (zumindest aus meinem Verstehen). Auch von dem, was ich verstanden habe, sollte Conda Matplotlib eingebaut haben, oder? Und es sollte das auch in meiner conda Tensorflow Umgebung laden, oder? Dies ist, was Dia mein Tutor sagte
There is no need to install further packages like numpy or matplotlib, since Anaconda contains current versions of them already.'
und auch das, was ich konnte von allem nehmen ich gegoogelt und StackOverflowed. Weder Googeln noch StackOverflowing gaben mir eine gute Antwort (vielleicht auch, weil ich noch nicht genug verstehe).
Meine beste Schätzung wäre, dass ich noch Matplotlib in meine Tensorflow Conda-Umgebung aufnehmen muss, aber das würde sowohl meinem Tutor & Google widersprechen, während ich auch nicht wissen würde, wie man das macht.
edit: etwas falsch
conda install matplotlib
ich immer noch Angst, bin mit meiner Conda tensorflow Umgebung conda list
gab mir, dass matplotlib war nicht in meinem tensorflowenvironment, so dass ich
Package plan for installation in environment /home/leon/.conda/envs/tensorflow:
The following NEW packages will be INSTALLED:
cycler: 0.10.0-py35_0
dbus: 1.10.10-0
expat: 2.1.0-0
fontconfig: 2.12.1-3
freetype: 2.5.5-2
glib: 2.50.2-1
gst-plugins-base: 1.8.0-0
gstreamer: 1.8.0-0
icu: 54.1-0
jpeg: 9b-0
libffi: 3.2.1-1
libgcc: 5.2.0-0
libiconv: 1.14-0
libpng: 1.6.27-0
libxcb: 1.12-1
libxml2: 2.9.4-0
matplotlib: 2.0.0-np112py35_0
mkl: 2017.0.1-0
numpy: 1.12.0-py35_0
pcre: 8.39-1
pyparsing: 2.1.4-py35_0
pyqt: 5.6.0-py35_2
python-dateutil: 2.6.0-py35_0
pytz: 2016.10-py35_0
qt: 5.6.2-3
sip: 4.18-py35_0
six: 1.10.0-py35_0
Proceed ([y]/n)? y
Was sagt mir auch, dass numpy fehlte? Kann jemand bestätigen, dass dies jetzt korrekt ist, oder ist da etwas mit meinem Conda fischig?
klar zu sein, da die Antwort nicht ganz explizit ist, dann ist dies das erwartete Verhalten und absolut mit Ihrer Umgebung oder Conda nichts ist falsch. – darthbith