From: John H. <jdh...@ac...> - 2003-11-05 14:43:59
|
>>>>> "LUK" == LUK ShunTim <shu...@po...> writes: LUK> I followed the link in the matplotlib site and installed gtk LUK> 2.2.4.1 from the sf site and the problem goes away. This LUK> version has all the images libraries with them. I must LUK> bookmark it! Good news ... LUK> Another question: I've set the environmental variable AFMPATH LUK> in the registry via the control panel but matplotlib LUK> complains that the .afm files are not there. I cannot replicate this problem on my system. Are the *.afm files in E:\Py23e\share\matplotlib? Are you sure you are running the right version of python, ie, do you still get the error with > E:\Py23e\python simple_plot.ps -dPS You might want to add a diagnostic debug line to backends/backend_ps.py to print the paths that it is searching. After line 422 in that file, insert a new line that prints the paths, eg, def _get_afm_filenames(self): paths = [os.path.join(distutils.sysconfig.PREFIX, 'share', 'matplotlib')] if os.environ.has_key('AFMPATH'): afmpath = os.environ['AFMPATH'] if afmpath.find(';')>0: #win32 style paths.extend(afmpath.split(';')) elif afmpath.find(':')>0: # unix style paths.extend(afmpath.split(':')) else: paths.append(afmpath) *** print paths fnames = [] And let me know what it reports. If you are using the fonts that ship with matplotlib, you shouldn't even need to set the AFMPATH because it automatically looks in the share/matplotlib subdir of your python install dir. You may also want to verify that matplotlib is finding your environment variable by doing > python >>> import os >>> print os.environ.has_key('AFMPATH') If the *.afm fonts are in the share/matplotlib dir, and you are using the right python, and the paths look correct from the diagnostic information above, the only thing I can think of is that these files are not readable by you (admin versus user thing?). To test this try > python >>> fh = file('E:\Py23e\\share\\matplotlib\\phvl8a.afm', 'r') >>> s = fh.read() >>> len(s) Let me know.... JDH |