【问题标题】:installing jupyter notebook on an Amazon AWS在 Amazon AWS 上安装 jupyter notebook
【发布时间】:2020-03-09 21:22:08
【问题描述】:

我有一些 AWS 服务器,我正在尝试在其上安装 jupyter notebook。

我执行以下步骤:

转到我的主目录并使用

创建一个虚拟环境
python3.6 -m venv env

激活 venv

source env/bin/activate

安装 Jupyter

python -m pip install --upgrade pip

python -m pip install jupyter

运行 jupyter 笔记本

jupyter notebook

在我运行 jupyter notebook 之前,一切似乎都正常。

我收到以下错误:

(env) root@ip-172-51-23-114:/home/USER# jupyter notebook --allow-root
[I 21:14:53.193 NotebookApp] Serving notebooks from local directory: /home/USER
[I 21:14:53.193 NotebookApp] The Jupyter Notebook is running at:
[I 21:14:53.193 NotebookApp] http://localhost:8888/?token=4a83abb3edf214bff5796dae4cf0ed756b1d99972e4134e7
[I 21:14:53.193 NotebookApp]  or http://127.0.0.1:8888/?token=4a83abb3edf214bff5796dae4cf0ed756b1d99972e4134e7
[I 21:14:53.193 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:14:53.198 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-25435-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=4a83abb3edf214bff5796dae4cf0ed756b1d99972e4134e7
     or http://127.0.0.1:8888/?token=4a83abb3edf214bff5796dae4cf0ed756b1d99972e4134e7
qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)
Couldn't find a suitable web browser!
Set the BROWSER environment variable to your desired browser.
Warning: program returned non-zero exit code #1
WARNING: You don't seem to have any mimeinfo.cache files.
Try running the update-desktop-database command. If you
don't have this command you should install the
desktop-file-utils package. This package is available from
http://freedesktop.org/wiki/Software/desktop-file-utils/
Can't call method "get_value" on an undefined value at /usr/bin/mimeopen line 159.
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: x-www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: firefox: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: iceweasel: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: seamonkey: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: mozilla: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: epiphany: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: konqueror: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: google-chrome: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening 'file:///root/.local/share/jupyter/runtime/nbserver-25435-open.html'

我通过 RStudio 中的终端安装 python 和 jupter notebook。

我应该尝试在实例上安装 chrome 或其他网络浏览器吗?

【问题讨论】:

    标签: python amazon-web-services jupyter-notebook


    【解决方案1】:

    根据您配置的网络权限,您可以尝试使用域后跟端口连接到 EC2 实例上的 Jupyter 笔记本。例如,

    https://<ec2-address>:<port>

    对于us-west-2 区域中的示例实例:

    https://ec2-52-39-239-66.us-west-2.compute.amazonaws.com:8888/

    它可能会在 EC2 身份验证窗口中提示您输入令牌,或者您可以简单地将其附加到上述 URL 的末尾:

    https://ec2-52-39-239-66.us-west-2.compute.amazonaws.com:8888/?token=4a83abb3edf214bff5796dae4cf0ed756b1d99972e4134e7

    【讨论】:

    • 谢谢!我之前没有看到你的评论。我花了一些时间学习本教程:medium.com/@josemarcialportilla/… - 我设法让 Jupyter 启动并运行,但出现错误 404 : Not Found You are requesting a page that does not exist! - 这是我的 https://ec2-xxxxxxxxxx.us-west-2.compute.amazonaws.com:8888/tree 链接。所以树没有显示任何东西(但我在左上角得到一个 Jupyter 徽标)即使使用 https://52.90.50.85:8888/tree 也会将我带到错误 404 页面。
    • 在线简要阅读这可能是由于隐藏文件夹。我有一些 jupyter 文件保存为 .jupyter 等。
    • 查看这个 github 问题:github.com/jupyter/notebook/issues/2382
    猜你喜欢
    • 2018-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多