- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试在基于 python 3 的 Docker 中运行 jupyter 笔记本。笔记本启动但将容器 ID 显示为 ip。如果我在打开链接后在浏览器中将其更改为“localhost:”,它确实有效。
如何让它正常工作并在 url 中显示 localhost:?/操作系统:Ubuntu 18.04/
编辑:我试过 jupyter/minimal-notebook这有效,显示本地主机,但它基于 ubuntu 18.04,它与我稍后想在笔记本中使用的一些包不兼容。
docker 文件:
FROM python:3
RUN apt-get -y update \
&& apt-get upgrade -y \
&& apt-get install -y \
curl \
vim \
xterm
RUN pip install --upgrade pip
RUN pip install --no-cache-dir jupyter numpy matplotlib
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents
# kernel crashes.
ENV TINI_VERSION v0.6.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini
ENTRYPOINT ["/usr/bin/tini", "--"]
EXPOSE 8888
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]
构建后运行
docker run --rm -it -p 8888:8888 -v "$PWD":/home/work e4b37115446d
输出:
[I 11:48:12.580 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 11:48:12.826 NotebookApp] Serving notebooks from local directory: /
[I 11:48:12.826 NotebookApp] 0 active kernels
[I 11:48:12.826 NotebookApp] The Jupyter Notebook is running at:
[I 11:48:12.826 NotebookApp] http://3b906c2d97f3:8888/?token=06d43a78966a7b7e5fd04318183fa3e7af5bca7542477d31
[I 11:48:12.826 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:48:12.827 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time, to login with a token:
http://3b906c2d97f3:8888/?token=06d43a78966a7b7e5fd04318183fa3e7af5bca7542477d31&token=06d43a78966a7b7e5fd04318183fa3e7af5bca7542477d31
最佳答案
在运行容器时使用 --hostname
标志。如果将其留空,则默认为容器名称。
docker run --rm -it -p 8888:8888 --hostname localhost jup
运行时:
[I 14:58:32.508 NotebookApp] The Jupyter Notebook is running at:
[I 14:58:32.508 NotebookApp] http://localhost:8888/?token=0e59cd9003b843f529b9bc6e7b39921001ddfdb253c029e9
关于python - Docker jupyter notebook 使用容器 id 作为 ip,localhost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50666176/
在尝试安装 jupyter 的许多不同方法之后,它似乎没有正确安装。 根据我最近遇到的 MacOS 系统 python 问题,可能与 MacOS 相关 pip install jupyter --us
命名 Jupyter Notebook 时,如果使用空格,即 This is my notebook.ipynb 然后,当使用网络浏览器打开时,它的渲染效果非常好。然而,空格在命令行环境中是有害的。但
运行 jupyter notebook和 jupyter server给我非常相似的结果,描述也非常相似。 ❯ jupyter notebook -h The Jupyter HTML Noteboo
是否可以在 Jupyter Lab 中使用笔记本扩展 (nbextensions)? 我认为我的扩展已启用...我调用 jupyter nbextension enable事先在他们身上。但我没有在
我将 Jupyter 与 Anaconda3 结合使用。 我的 Anaconda3\ 和 Anaconda3\Scripts\ 文件夹已添加到 %PATH% 变量中。 尽管 jupyter.exe 位
我将 Jupyter 用于我公司的分析。我想制作显示一些漂亮图表的实时页面。我将在大厅的大显示器上显示此页面,我希望它自动刷新。 有什么方法可以通过刷新浏览器页面来触发“运行所有单元格”吗?或者,是否
%store 魔术功能可以保存大型 python 对象,供您在不同 session 之间使用,但我想找出文件的实际位置,以便我也可以在不同 session 之间传输它们不同的电脑。我正在使用 Wind
我在 Windows 10 的本地 Ubunto 机器上运行 Jupyter notebook。问题是所有文本都与屏幕右侧对齐,包括菜单 - 例如"file"选项卡位于最右侧。以这种方式阅读文本非常困
Closed. This question is not reproducible or was caused by typos。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-t
我尝试使用以下内容创建指向 jupyter 笔记本中标题的内部链接。 SO上的各种答案,例如here在我的笔记本中似乎没有按预期工作。下面的代码创建了一个链接,但在尝试访问该链接时没有任何 react
这个问题在这里已经有了答案: How can I share Jupyter notebooks with non-programmers? [closed] (6 个回答) 5年前关闭。 我安装了一
我试图在 jupyter notebook 中自动完成路径。按“tab”后,它显示的不仅仅是文件夹或文件。我认为这些是python的内置功能。有没有办法在自动完成路径时只显示路径和文件? 谢谢! 最佳
我在 Jupyter notebook 中组合了一些数据分析步骤。 随着数据的变化,我希望能够 重新运行所有单元格(以考虑新数据) 转换为html以供查看 我知道我可以通过 jupyter nbcon
在 jupyter 中 笔记本 , 我可以用 nbextensions 配置自动单元计时,结果是这样的: 我怎样才能在 jupyter 中做到这一点 实验室 ?我没有找到任何做类似事情的扩展。 观察:
我正在寻找一个带有 Jupter 可选组件的数据处理集群。 gcloud beta dataproc clusters create cluster-1ea3 --enable-component-g
Jupyter Notebook 的自动完成功能似乎有效,但不知何故它会显示该方法的重复选项。例如下面: 对于每个可能的选项,下拉菜单将显示 2 个相同的选项。为什么会发生这种情况以及如何解决? 最佳
每当我将 jupyter 实验室窗口推到一边时,“简单模式”就会被激活。这导致只显示一个选项卡,而其他选项卡被隐藏。这非常烦人,我不敢相信这是一个标准功能(只是再次安装了 jupyter 实验室)。
当我使用jupyter notebook时, 我希望新单元格的类型为“markdown”。 默认情况下,新单元格的类型为“代码”。我应该修改哪个配置文件以及应该更改哪个变量? 最佳答案 转到您的pyt
奇怪的是,互联网上没有关于如何在 Jupyter 环境下运行 Haskell 的说明。任何引导您实现此目的的文档都需要您从源代码编译,但是当尝试这样做时,会发生各种构建错误。 奇怪的是,一个肯定会给
在带有 ipython 内核的 Jupyter 中,是否有以非阻塞方式执行单元格的规范方法? 理想情况下,我希望能够运行一个单元格 %%background time.sleep(10) print(
我是一名优秀的程序员,十分优秀!