元のタイトル: MPLCONFIGDIR .matplotlib not writeable on matplotlib import
pylearn2 のチュートリアルを実行していますが、インポート時にエラーが発生しmatplotlib.pyplot
ます。おそらく不要な情報は、Vagrant によって生成された VirtualBox で実行しているということです。django に関する同様のエラーがいくつか見られましたが、ウェブホストしようとしているわけでも、スペースが不足しているわけでもありません。安全ではないので、ルートとしてPythonを実行しようとしましたが、それでも機能しませんでした。同じエラーで MPLCONFIGDIR 変数を設定しようとしました。他に追加できる情報があれば教えてください。ありがとう。
Traceback (most recent call last):
File "/home/vagrant/pylearn2/pylearn2/scripts/plot_monitor.py", line 274, in <module>
main()
File "/home/vagrant/pylearn2/pylearn2/scripts/plot_monitor.py", line 57, in main
import matplotlib.pyplot as plt
File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 774, in <module>
rcParams = rc_params()
File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 692, in rc_params
fname = matplotlib_fname()
File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 604, in matplotlib_fname
fname = os.path.join(get_configdir(), 'matplotlibrc')
File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 253, in wrapper
ret = func(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 475, in _get_configdir
raise RuntimeError("'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored "% (h, h))
RuntimeError: '/home/vagrant' is not a writable dir; you must set /home/vagrant/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored
/home/vagrant は私のホームディレクトリなので書き込み可能ですが、関係者のために...
vagrant@precise64:~$ ls -ld /home/vagrant
drwxrwxrwx 1 vagrant vagrant 16384 Sep 26 17:40 /home/vagrant
vagrant@precise64:~$ ls -ld /home/vagrant/.matplotlib/
drwxrwxrwx 1 vagrant vagrant 4096 Sep 26 18:07 /home/vagrant/.matplotlib/
アップデート:
によって引き起こされるようです
OSError: [Errno 26] Text file busy: '/home/vagrant/.matplotlib/tmp3ciLMo'
これは、ホームフォルダーをsynced_folderとしてマウントする浮浪者と関係があると思われます