Jupyter Notebook-无法连接到内核

Dav*_*ers 4 jupyter-notebook

我尝试使用pip3 install jupyter安装jupyter笔记本。每次启动新的jupyter笔记本时,该笔记本都无法连接到内核。参见附加我的requirements.txt文件的下面的屏幕截图,我也在使用Python 3.6.8版本。Jupyter版本为4.4.0,笔记本版本为5.7.4。

我在哪里出错了,该如何解决?谢谢!

attrs==18.2.0
backcall==0.1.0
bleach==3.1.0
colorama==0.4.1
cycler==0.10.0
decorator==4.3.2
defusedxml==0.5.0
entrypoints==0.3
ipykernel==5.1.0
ipython==7.3.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
jedi==0.13.3
Jinja2==2.10
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
kiwisolver==1.0.1
MarkupSafe==1.1.1
matplotlib==3.0.3
mistune==0.8.4
nbconvert==5.4.1
nbformat==4.4.0
notebook==5.7.4
numpy==1.16.2
pandas==0.24.1
pandocfilters==1.4.2
parso==0.3.4
pickleshare==0.7.5
prometheus-client==0.6.0
prompt-toolkit==2.0.9
Pygments==2.3.1
pyparsing==2.3.1
pyrsistent==0.14.11
python-dateutil==2.8.0
pytz==2018.9
pywinpty==0.5.5
pyzmq==18.0.0
qtconsole==4.4.3
scikit-learn==0.20.3
scipy==1.2.1
seaborn==0.9.0
Send2Trash==1.5.0
six==1.12.0
sklearn==0.0
terminado==0.8.1
testpath==0.4.2
tornado==6.0
traitlets==4.3.2
wcwidth==0.1.7
webencodings==0.5.1
widgetsnbextension==3.4.2
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

小智 15

您最近可能已将Tornado更新为6.0.0。尝试将其重新安装到版本5.1.1。它只是帮助了我。在此上浪费了宝贵的星期六时间1小时。

  • 啊没关系。我使用了错误的语法。我用pip install tornado == 5.1.1和wala!现在,我可以再次连接到jupyter笔记本。这是龙卷风6.0的错误吗?看起来jupyter无法在Tornado 6.0上运行,并且默认情况下已安装,这似乎很奇怪。 (3认同)
  • 使用conda安装的tornado==5.1.1并没有解决我的问题。 (2认同)

sri*_*tel 9

使用以下命令创建 conda 环境:

conda create -n my_env python=3
Run Code Online (Sandbox Code Playgroud)

使用以下命令激活环境:

source activate my_env
Run Code Online (Sandbox Code Playgroud)

使用以下命令安装 ipykernel:

conda install ipykernel

ipython kernel install --name my_env --user
Run Code Online (Sandbox Code Playgroud)

现在打开 jupyter 并从内核选项中选择“my_env”。(路径:jupyter - >内核 - >更改内核 - > my_env)


cha*_*esh 5

就我而言,我刚刚更新了我的 jupyter 并且它起作用了。


Flo*_*ent 5

这在 Python 3.7 下对我有用。

pip3 install tornado==5.1.1
pip3 install notebook==5.7.4
Run Code Online (Sandbox Code Playgroud)

  • 这为我解决了!经过几天的寻找解决方案............ (2认同)