简体   繁体   English

ipython笔记本散景和output_notebook

[英]ipython notebook bokeh and output_notebook

What is happening when I get the following error? 出现以下错误时会发生什么情况? There is no error from within the notebook. 笔记本内没有错误。 But when I do this in regular iPython I'm wondering what is happening.... and what In: means... see error below.... (last 5 lines) 但是,当我在常规iPython中执行此操作时,我想知道发生了什么...以及In:意味着...请参见下面的错误...(最后5行)

#set up domain and function with max
x = np.linspace(lower, upper, steps)
y = func(x)
y_max = np.amax(y) * 1.1

output_notebook()

p = figure(
   tools="pan,box_zoom,reset,save",
   y_range=[0, y_max], title="Some Beta Distributions",
   x_axis_label='days', y_axis_label='value'
)

p.line(x, y, legend = "pdf", line_color="blue")

show(p)
/usr/local/lib/python2.7/dist-packages/IPython/utils/path.py:303: UserWarning: IPython dir
 '/home/vagrant/.ipython' is not a writable location, using a temp directory.
  " using a temp directory.".format(ipdir))
In :
In :

It means that for whatever reason, your account does not have permission to modify the contents of the .ipython folder, which IPython uses to store some settings and cache some data, so IPython will create and use a temporary directory instead. 这意味着无论出于何种原因,您的帐户都无权修改.ipython文件夹的内容,IPython使用该文件夹来存储一些设置并缓存一些数据,因此IPython会创建并使用一个临时目录。

To fix this, you should either modify the permissions on the .ipython folder from the command line and give yourself read/write permissions, or modify the IPYTHON_DIR environment variable to point to a folder you do have permissions for. 要解决此问题,您应该.ipython修改.ipython文件夹上的权限并赋予自己读/写权限,或者修改IPYTHON_DIR环境变量以指向您确实具有其权限的文​​件夹。

Or, if you don't feel like fixing the error + don't mind that IPython is using a temp folder, don't do anything. 或者,如果您不想修复错误,并且不介意IPython使用的是临时文件夹,请不要执行任何操作。

In: is the standard ipython prompt. In:是标准的ipython提示符。 It is ipython 's way of telling you that it is waiting for input (just like >>> in the standard python interpreter). 这是ipython告诉您它正在等待输入的方式(就像标准python解释器中的>>>一样)。

Note that output_notebook will only function in the browser (ie, in the notebook). 请注意, output_notebook仅在浏览器(即笔记本电脑)中起作用。 If you want to run code in a command line ipython shell (I am assuming that is what you mean by "in regular iPython") then you will have to use output_file or one of the functions in bokeh.embed . 如果要在命令行ipython shell中运行代码(我假设这是“在常规iPython中”的意思),则必须使用output_filebokeh.embed中的功能之一。

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

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