Seite 1 von 1

Wie startet man ein Programm für Matplotlib ?

Verfasst: Mittwoch 2. Juli 2014, 13:50
von funkheld
Hallo, guten Tag.
Ich möchte einpaar Demos ausprobieren von Matplotlib.
Habe Python 2.7.8 mit Matplotlib für Python 2.7 und auch Numpy 1.8.1 für Python 2.7 installiert.

Habe das Demo von hier:
http://matplotlib.org/users/pyplot_tutorial.html

Es kommt diese Fehlermeldung im IDLE :
---------------------
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>

Traceback (most recent call last):
File "C:\Users\Downloads\test.py", line 1, in <module>
import matplotlib.pyplot as plt
File "D:\Python27\lib\site-packages\matplotlib\__init__.py", line 111, in <module>
raise ImportError("matplotlib requires dateutil")
ImportError: matplotlib requires dateutil
>>>
---------------------------

Dies ist das Demo:

Code: Alles auswählen

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()
Danke.
Gruss

Re: Wie startet man ein Programm für Matplotlib ?

Verfasst: Mittwoch 2. Juli 2014, 14:01
von EyDu

Re: Wie startet man ein Programm für Matplotlib ?

Verfasst: Mittwoch 2. Juli 2014, 14:20
von MagBen
Deine Python Installation ist wohl noch nicht vollständig. Es kann aber ziemlich mühsam sein, sich die ganzen Bibliotheken fürs wissenschaftliche Arbeiten mit Python in der richtigen Kombination zu holen (32/64bit, Python 2.7 oder Python 3). Zum Glück ist die Arbeit aber schon gemacht worden, schau Dir mal WinPython an: http://winpython.sourceforge.net/

Das ist eine Python-Distribution für Windows, die viele Extra-Bibliotheken mitbringt (Numpy, Scipy, Matplotlib, PyQt). Das ganze gibt's für 32bit und für 64bit sowie für Python 2.7 und Python 3. Du brauchst es nicht zu installieren, es reicht, wenn Du das Zip entpackst und die Tools aus dem Verzeichnis heraus startest. So kannst Du ohne große Probleme alle 4 möglichen Kombinationen auf dem gleichen Rechner testen. Wenn Du dann wirklich eine Distribution installiert haben möchtest (in der Registry und im Pfad) dann gibt's dafür auch ein Kommando.

Als wirklich tolle GUI ist dann noch Spyder dabei, dort kannst Du fast wie in Matlab arbeiten.

Re: Wie startet man ein Programm für Matplotlib ?

Verfasst: Mittwoch 2. Juli 2014, 14:38
von funkheld
Die habe ich von hier:

https://www.python.org/download/

Gruss

Re: Wie startet man ein Programm für Matplotlib ?

Verfasst: Mittwoch 2. Juli 2014, 14:41
von MagBen
Dort ist aber nicht Matplotlib drin enthalten.