简体   繁体   English

OS X python脚本无法读取/Users/myname/.matplotlib/matplotlibrc

[英]os x python script not reading /Users/myname/.matplotlib/matplotlibrc

Running the script below in Terminal points to 在终端中运行下面的脚本指向

import matplotlib
print(matplotlib.matplotlib_fname())

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc

but running it in TextMate I get 但我在TextMate中运行它

/Users/myname/.matplotlib/matplotlibrc /Users/myname/.matplotlib/matplotlibrc

What's controlling which matplotlibrc is used and how do I control it? 什么控制着使用哪个matplotlibrc?如何控制它?

I installed the python-2.7 using brew. 我使用brew安装了python-2.7。

I found the answer. 我找到了答案。 I needed to put 我需要放

export MPLCONFIGDIR=$HOME/.matplotlib

somewhere that would be read by running ~/.profile (eg in ~/.profile). 通过运行〜/ .profile可以读取的地方(例如〜/ .profile)。

I don't know why it is not found automatically. 我不知道为什么不会自动找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM