Anfängerfrage: Ich habe mir das bundle pythonxy geladen. Bis auf matplotlib läuft alles tadellos. Beim Importiren von matplotlib bekomme ich die u.g. Fehlermedlung, kann aber nichts damit anfangen. Kann mir jemand weiter helfen ?
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import matplotlib
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\__init__.py", line 694, in <module>
rcParams = rc_params()
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\__init__.py", line 615, in rc_params
fname = matplotlib_fname()
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\__init__.py", line 565, in matplotlib_fname
fname = os.path.join(get_configdir(), 'matplotlibrc')
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\__init__.py", line 240, in wrapper
ret = func(*args, **kwargs)
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\__init__.py", line 439, in _get_configdir
raise RuntimeError("Failed to create %s/.matplotlib; consider setting MPLCONFIGDIR to a writable directory for matplotlib configuration data"%h)
RuntimeError: Failed to create C:\/.matplotlib; consider setting MPLCONFIGDIR to a writable directory for matplotlib configuration data
MB
Matplotlib import probleme
Vielen Dank erst einmal. Für mich sieht es so aus, als ob auf ein Verzeichnis geschrieben werden soll, wo kein Zugriff für vorhanden ist. Die Fehlermeldung schlägt ja vor:
Was ist damit gemeint ?consider setting MPLCONFIGDIR to a writable directory for matplotlib configuration data
Hast du Schreibrechte auf C: ?
Versuch mal das in der Python-Konsole:
Hier noch was:
http://matplotlib.sourceforge.net/faq/e ... lconfigdir
Setz die Variable einfach auf ein Verzeichnis, auf das du Zugriff hast.
Versuch mal das in der Python-Konsole:
Code: Alles auswählen
>>> import os
>>> os.mkdir("C:\/.matplotlib")
http://matplotlib.sourceforge.net/faq/e ... lconfigdir
Setz die Variable einfach auf ein Verzeichnis, auf das du Zugriff hast.
Super, Vielen Dank. Nach dem Erstellen von .matplotlib konnte ich es importieren. Dann bin ich aber auf das nächste Problem beim importieren von pylab gestossen mit der folgenden Fehlermeldung:
Wie kann ein einzelnes Modul fehlen ?
MB
]>>> from pylab import*
Traceback (most recent call last):File "<pyshell#10>", line 1, in <module>
from pylab import*
File "C:\Program Files\pythonxy\python\Lib\site-packages\pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\pylab.py", line 206, in <module>
from matplotlib import mpl # pulls in most modules
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\mpl.py", line 1, in <module>
from matplotlib import artist
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\artist.py", line 4, in <module>
import matplotlib.cbook as cbook
AttributeError: 'module' object has no attribute 'cbook'[/quote
Wie kann ein einzelnes Modul fehlen ?
MB
Importiere halt mal gezielt die einzelnen Module und nicht mit "import *".
Bekommst du dann immer noch diesen Fehler?
Ansonsten, falls du nur matplotlib und nicht die anderen Packages von pythonxy benötigst, nimm mal eine Python-Standardinstallation und installier matplotlib und numpy manuell.
Installationsdateien für die 2 Packages für Python 2.6 findest du, wenn du hier im Forum nach meinen Beiträgen suchst.
Bekommst du dann immer noch diesen Fehler?
Ansonsten, falls du nur matplotlib und nicht die anderen Packages von pythonxy benötigst, nimm mal eine Python-Standardinstallation und installier matplotlib und numpy manuell.
Installationsdateien für die 2 Packages für Python 2.6 findest du, wenn du hier im Forum nach meinen Beiträgen suchst.
Ja, egal welches package ich importieren will, ich bekomme die Fehlermeldung, dass
File "C:\Program Files\pythonxy\python\Lib\site-packages\matplotlib\artist.py", line 4, in <module>
import matplotlib.cbook as cbook
AttributeError: 'module' object has no attribute 'cbook'
Aber trotzdem, Danke für die Mühe.>>> from matplotlib import pylab