[パイソン、Jupyter、Ubuntuの16]許可
私はbokeh
をインストールしたpython3.5のvirtualenvのを持っています。私は、インポートするとうまくグラフを定義することができます。
p.xaxis.axis_label = 'petal len'
p.yaxis.axis_label = 'petal width'
p.circle(flowers['petal_length'], flowers['petal_width'], color=colors, fill_alpha=0.2, size=10)
が、私はshow(p)
を呼び出すときに、私は以下のようになります。
PermissionError Traceback (most recent call last)
<ipython-input-7-52ee71fc1db5> in <module>()
2 p.yaxis.axis_label = 'petal width'
3 p.circle(flowers['petal_length'], flowers['petal_width'], color=colors, fill_alpha=0.2, size=10)
----> 4 show(p)
/home/USERNAME/ve/ml/lib/python3.5/site-packages/bokeh/io.py in show(obj, browser, new, notebook_handle)
298 if obj not in _state.document.roots:
299 _state.document.add_root(obj)
--> 300 return _show_with_state(obj, _state, browser, new, notebook_handle=notebook_handle)
301
302
/home/USERNAME/ve/ml/lib/python3.5/site-packages/bokeh/io.py in _show_with_state(obj, state, browser, new, notebook_handle)
316
317 if state.file or not shown:
--> 318 _show_file_with_state(obj, state, new, controller)
319
320 return comms_handle
/home/USERNAME/ve/ml/lib/python3.5/site-packages/bokeh/io.py in _show_file_with_state(obj, state, new, controller)
321
322 def _show_file_with_state(obj, state, new, controller):
--> 323 filename = save(obj, state=state)
324 controller.open("file://" + filename, new=_new_param[new])
325
/home/USERNAME/ve/ml/lib/python3.5/site-packages/bokeh/io.py in save(obj, filename, resources, title, state, validate)
380
381 filename, resources, title = _get_save_args(state, filename, resources, title)
--> 382 _save_helper(obj, filename, resources, title, validate)
383 return os.path.abspath(filename)
384
/home/USERNAME/ve/ml/lib/python3.5/site-packages/bokeh/io.py in _save_helper(obj, filename, resources, title, validate)
447 html = standalone_html_page_for_models(obj, resources, title)
448
--> 449 with io.open(filename, "w", encoding="utf-8") as f:
450 f.write(decode_utf8(html))
451
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.5/runpy.html'
私は無駄にchown -R 755 /usr/lib/python3.5
を試してみました。 ~/virtualenv/lib/python3.5
は(奇妙なことに)ほとんど777ですが、これは新しくインストールしたときのように、私はそれが意図的だと思います。
'output_notebook'(インラインプロット用)または' output_file'(明示的に保存する場所を指定する)を呼び出しましたか? – bigreddot
いいえ、それはそれを修正!それはむしろ驚くべき問題です!これを答えとして掲示してください。 – DeusXMachina
次の '0.12.5'リリースでは、現在の場所が書き込み可能でない場合(https://github.com/bokeh/bokeh/pull/5942)、OS提供の一時ファイルを使用するように変更されるため、ポイントはおそらく疑問です。いずれにしても、明示的に 'output_file'を使用することをお勧めします(すべての例とドキュメンテーションはこの習慣を実証しています)。 – bigreddot