简体   繁体   English

Jupyter Notebook 无法在 VS Code 中打开

[英]Jupyter notebook not opening in VS Code

While setting up my new system, I am trying to run my notebook file on VS Code but as soon as I open VS Code it give me this error在设置我的新系统时,我试图在 VS 代码上运行我的笔记本文件,但是一旦我打开 VS 代码,它就会给我这个错误

Failed to detect Jupyter Notebook. Please use 'Select Jupyter Notebook' command

in the output:在输出中:

Unable to determine version of Jupyter, Traceback (most recent call last):
  File "C:\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
    from notebook.notebookapp import main
  File "C:\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 46, in <module>
    from zmq.eventloop import ioloop
  File "C:\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
    from zmq import backend
  File "C:\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "C:\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
    raise value
  File "C:\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "C:\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "C:\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.

I have installed all the plugins which were necessary, ran various commands, I also updated the notebook.我已经安装了所有必要的插件,运行了各种命令,我还更新了笔记本。 conda install notebook

I am using: anaconda 3 vs code 1.26.1 windows 10 I cant start new notebooks or use an existing one either.我正在使用:anaconda 3 vs code 1.26.1 windows 10 我无法启动新笔记本或使用现有笔记本。 Please help, and let me know if any more information is required.请帮忙,如果需要更多信息,请告诉我。

  1. Check the required extensions installed in vscode.检查 vscode 中安装的所需扩展。

  2. install jupyter and ipython packages in your python venv using pip:使用 pip 在 python venv 中安装 jupyter 和 ipython 包:

     pip install jupyter pip install ipython
  3. If its still not working try to change the python kernal in the top right corner of ipynb notebook.如果它仍然无法正常工作,请尝试更改 ipynb 笔记本右上角的 python 内核。

This is due to running jupyter without first activating the environment for Python 3.7.这是由于在没有先激活 Python 3.7 环境的情况下运行jupyter This was fixed in the 2018.12.0 release of the extension.这已在扩展的 2018.12.0 版本中修复

When it fails with this response you can uninstall conda and jupyter and install python from VS Code and then update.当此响应失败时,您可以卸载condajupyter并从 VS Code 安装 python,然后更新。 Don't necessarily install conda and jupyter .不一定要安装condajupyter

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

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