import pylab (from matplotlib) fails

45 views
Skip to first unread message

elfnor

unread,
May 26, 2009, 8:44:42 PM5/26/09
to PortablePython
Hi

Importing the pylab module from matplotlib fails

>>> import pylab
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "E:\PortablePython_1.1_py2.5.4\App\lib\site-packages\pylab.py",
line 1, in <module>
from matplotlib.pylab import *
File "E:\PortablePython_1.1_py2.5.4\App\lib\site-packages\matplotlib
\pylab.py", line 206, in <module>
from matplotlib import mpl # pulls in most modules
File "E:\PortablePython_1.1_py2.5.4\App\lib\site-packages\matplotlib
\mpl.py", line 2, in <module>
from matplotlib import axis
File "E:\PortablePython_1.1_py2.5.4\App\lib\site-packages\matplotlib
\axis.py", line 9, in <module>
import matplotlib.font_manager as font_manager
File "E:\PortablePython_1.1_py2.5.4\App\lib\site-packages\matplotlib
\font_manager.py", line 1302, in <module>
_rebuild()
File "E:\PortablePython_1.1_py2.5.4\App\lib\site-packages\matplotlib
\font_manager.py", line 1294, in _rebuild
pickle_dump(fontManager, _fmcache)
File "E:\PortablePython_1.1_py2.5.4\App\lib\site-packages\matplotlib
\font_manager.py", line 939, in pickle_dump
pickle.dump(data, fh)
IOError: [Errno 2] No such file or directory


It seems the font_maanger module needs to read/write files to the
directory returned by
>>> matplotlib.get_configdir()
'H:\\.matplotlib'

which dosen't exist in a portable install.

The location of this directory can be changed with the MPLCONFIGDIR
environment variable in a fixed install.

Any clues?

thanks Eleanor
Reply all
Reply to author
Forward
0 new messages