problem with import pylab from a website

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Jan 20 15:27:56 EST 2005


>>>>> "jean" == jean rossier <jean.rossier at epfl.ch> writes:

    jean> Hello All, I am facing a problem while importing pylab
    jean> library(in a .py program file) via web browser however the
    jean> same program works when I execute it from the command
    jean> prompt.

    jean> Error message we get:


   Permission denied: '/usr/share/matplotlib/.ttffont.cache', referer:

One solution is to give yourself write permission to
/usr/share/matplotlib.  If this is not possible or in unpalatable for
sysadmin reasons, you have a couple of options.

matplotlib creates a font cache .ttffont.cache of the ttf files it
finds on your system.  If the HOME environment variable is set, it
places the cache file in the HOME dir.  So if setting HOME is a viable
option for you, simply set this to a writable directory on your system
and you are good to go.  This is the approach I recommend.

If HOME does not exist, matplotlib falls back on its data path: this
is where fonts, icons and other goodies live.  You can also customize
this directory by setting the MATPLOTLIBDATA environment variable.  If
you go this route, more all the files currently in
/usr/share/matplotlib to some other directory, say /my/dir, and make
sure it is writable, and then set MATPLOTLIBDATA to point to it.

Note matplotlib has a configuration file that controls all of the
default settings for the plot.  If you want to edit these, the edited
file can also be placed in the HOME directory.  See
http://matplotlib.sf.net/.matplotlibrc .

Hope this helps,
JDH



More information about the Python-list mailing list