开发者

Matplotlib cannot find facefile, is using old Python interpreter location

I've a script that utilised the Matplotlib library, the script works fine at home and i开发者_如何学Gon the Uni labs, but I have an issue when I try and run it on my work machine.

Originally, I was running the interpreter from my USB stick - no problems there - but I've recently copied the interpreter to the hard drive to save messing around, and now if I run the script without my USB stick in I get the following critical error (with spacing added for readability):

# lots of Traceback trimmed off here

File "d:\Python2.6.5\lib\site-packages\matplotlib\backends\backend_agg.py", 
line 221, in _get_agg_font
  font = FT2Font(str(fname))

RuntimeError: Could not open facefile F:\Apps\Python2.6.5\lib\site-packages\
matplotlib\mpl-data\fonts\ttf\Vera.ttf; Cannot_Open_Resource

As you would expect, it will work fine if I connect my USB stick with the interpreter on it.

Clearly somewhere, the library has a configuration somewhere that points it to the old USB location.

Where is this configuration data kept and/or how do I fix this?


matplotlib keeps it's config file in the .matplotlib directory finding the location of the directory

Change the MPLCONFIGDIR environment variable to change the directory location.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜