Jupyter-如何运行和安装?

时间:2020-02-22 06:24:03

标签: jupyter-notebook jupyter-lab

我需要在两台计算机(都是Linux Mint 19.2 Tina)上安装jupyter笔记本。

我已在一台计算机上安装并运行

jupyter notebook

我无法运行牢房。我单击运行,没有任何反应。不连接是什么意思?

enter image description here

在第二台计算机上运行

jupyter notebook

并且有一个错误:

Traceback (most recent call last):
  File "/home/linux/.local/bin/jupyter-notebook", line 5, in <module>
    from notebook.notebookapp import main
  File "/home/linux/.local/lib/python2.7/site-packages/notebook/__init__.py", line 25, in <module>
    from .nbextensions import install_nbextension
  File "/home/linux/.local/lib/python2.7/site-packages/notebook/nbextensions.py", line 31, in <module>
    from .config_manager import BaseJSONConfigManager
  File "/home/linux/.local/lib/python2.7/site-packages/notebook/config_manager.py", line 15, in <module>
    from traitlets.config import LoggingConfigurable
  File "/home/linux/.local/lib/python2.7/site-packages/traitlets/__init__.py", line 1, in <module>
    from .traitlets import *
  File "/home/linux/.local/lib/python2.7/site-packages/traitlets/traitlets.py", line 49, in <module>
    import enum
ImportError: No module named enum

我尝试安装

pip install --user pip enum34
pip install --upgrade pip enum34

但是没有帮助。仅适用于python3吗?

编辑 enter image description here

另一个问题:笔记本选项中没有python2 python3。

端子:

jupyter notebook
[I 13:08:08.694 NotebookApp] Serving notebooks from local directory: /media/linux/DATADISK/venv
[I 13:08:08.694 NotebookApp] The Jupyter Notebook is running at:
[I 13:08:08.694 NotebookApp] http://localhost:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c
[I 13:08:08.694 NotebookApp]  or http://127.0.0.1:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c
[I 13:08:08.694 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:08:08.697 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///home/linux/.local/share/jupyter/runtime/nbserver-12847-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c
     or http://127.0.0.1:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c

错误:

python3 -m ipykernel install --user
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/linux/.local/lib/python3.6/site-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/home/linux/.local/lib/python3.6/site-packages/ipykernel/connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 49, in <module>
    from .terminal.embed import embed
  File "/usr/lib/python3/dist-packages/IPython/terminal/embed.py", line 18, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/usr/lib/python3/dist-packages/IPython/terminal/interactiveshell.py", line 20, in <module>
    from prompt_toolkit.shortcuts import create_prompt_application, create_eventloop, create_prompt_layout, create_output
ImportError: cannot import name 'create_prompt_application'

1 个答案:

答案 0 :(得分:1)

尝试从Jupiter in a new environment重新开始。

注意:如果您使用的是python 2.7,则需要确保已安装venv。 A