Jupyter notebook 在Jupyter笔记本中使用conda环境

Jupyter notebook 在Jupyter笔记本中使用conda环境,jupyter-notebook,anaconda,conda,virtual-environment,Jupyter Notebook,Anaconda,Conda,Virtual Environment,我在windows 10上运行Anaconda,并使用Jupyter笔记本进行机器学习项目 我最近意识到康达的虚拟环境 我使用以下命令在conda中创建了一个虚拟环境 conda create -n test1 激活环境 activate test1 ipykernel中安装的环境(不确定使用的术语是否正确) 现在环境test1在jupyter笔记本中可见,但当我启动它时,我得到了内核启动。。。请稍候消息 下面是一些片段 同样在jupyter提示符中(同样不确定术语),我得到了以下错误

我在windows 10上运行Anaconda,并使用Jupyter笔记本进行机器学习项目

我最近意识到康达的虚拟环境

我使用以下命令在conda中创建了一个虚拟环境

conda create -n test1
激活环境

activate test1
ipykernel中安装的环境(不确定使用的术语是否正确)

现在环境
test1
在jupyter笔记本中可见,但当我启动它时,我得到了
内核启动。。。请稍候
消息

下面是一些片段

同样在jupyter提示符中(同样不确定术语),我得到了以下错误

[I 21:08:24.924 NotebookApp] Creating new notebook in /MachineLearning/ImageProcessing
[I 21:08:29.550 NotebookApp] Kernel started: ec56795d-df5b-48d5-8f95-473ab1253407
Traceback (most recent call last):
  File "C:\Users\shesh\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\shesh\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\traitlets\config\application.py", line 663, in launch_instance
    app.initialize(argv)
  File "<C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\decorator.py:decorator-gen-125>", line 2, in initialize
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\ipykernel\kernelapp.py", line 527, in initialize
    self.init_sockets()
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\ipykernel\kernelapp.py", line 287, in init_sockets
    self.init_iopub(context)
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\ipykernel\kernelapp.py", line 295, in init_iopub
    self.iopub_thread = IOPubThread(self.iopub_socket, pipe=True)
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\ipykernel\iostream.py", line 68, in __init__
    self._setup_pipe_in()
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\ipykernel\iostream.py", line 141, in _setup_pipe_in
    self._pipe_in = ZMQStream(pipe_in, self.io_loop)
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\zmq\eventloop\zmqstream.py", line 127, in __init__
    self._init_io_state()
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\zmq\eventloop\zmqstream.py", line 546, in _init_io_state
    self.io_loop.add_handler(self.socket, self._handle_events, self.io_loop.READ)
  File "C:\Users\shesh\AppData\Roaming\Python\Python38\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "C:\Users\shesh\AppData\Local\Programs\Python\Python38\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError
[W 21:09:29.591 NotebookApp] Timeout waiting for kernel_info reply from ec56795d-df5b-48d5-8f95-473ab1253407
[I 21:10:29.197 NotebookApp] Saving file at /MachineLearning/ImageProcessing/Untitled.ipynb

[I 21:08:24.924 NotebookApp]在/MachineLearning/ImageProcessing中创建新笔记本
[I 21:08:29.550 NotebookApp]内核已启动:ec56795d-df5b-48d5-8f95-473ab1253407
回溯(最近一次呼叫最后一次):
文件“C:\Users\shesh\AppData\Local\Programs\Python\Python38\lib\runpy.py”,第192行,位于\u run\u模块\u as\u main中
返回运行代码(代码、主全局、无、,
文件“C:\Users\shesh\AppData\Local\Programs\Python\Python38\lib\runpy.py”,第85行,在运行代码中
exec(代码、运行\全局)
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\ipykernel\u launcher.py”,第16行,在
app.launch_new_instance()
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\traitlets\config\application.py”,第663行,在launch\u实例中
应用程序初始化(argv)
文件“”,第2行,在初始化中
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\traitlets\config\application.py”,第87行,catch\u config\u error
返回方法(应用程序、*args、**kwargs)
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\ipykernel\kernelapp.py”,第527行,在初始化中
self.init_sockets()
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\ipykernel\kernelapp.py”,第287行,在init\u套接字中
self.init_iopub(上下文)
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\ipykernel\kernelapp.py”,第295行,在init_iopub中
self.iopub_thread=IOPubThread(self.iopub_套接字,管道=True)
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\ipykernel\iostream.py”,第68行,在\uuu init中__
自。\设置\管道\插入()
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\ipykernel\iostream.py”,第141行,位于
self.\u pipe\u in=ZMQStream(pipe\u in,self.io\u循环)
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\zmq\eventloop\zmqstream.py”,第127行,在\uuu init中__
self._init_io_state()
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\zmq\eventloop\zmqstream.py”,第546行,处于初始io状态
self.io\u loop.add\u处理程序(self.socket、self.handle\u事件、self.io\u loop.READ)
文件“C:\Users\shesh\AppData\Roaming\Python38\site packages\tornado\platform\asyncio.py”,第99行,在add\u处理程序中
self.asyncio\u loop.add\u reader(fd,self.\u handle\u events,fd,IOLoop.READ)
文件“C:\Users\shesh\AppData\Local\Programs\Python\Python38\lib\asyncio\events.py”,第501行,在add\u reader中
引发未实现的错误
未实现错误
[W 21:09:29.591 NotebookApp]等待来自ec56795d-df5b-48d5-8f95-473ab1253407的内核信息回复超时
[I 21:10:29.197 NotebookApp]将文件保存在/MachineLearning/ImageProcessing/Untitled.ipynb

我只想在jupyter笔记本中使用新创建的环境。

请尝试以下步骤:

source activate test1
conda install ipykernel
ipython kernel install --name test1 --user 

这确实是“”的副本不幸的是,在这个问题上有很多错误的答案,但我可以特别推荐作为一个正确的途径。@merv我遵循了你评论中答案中提到的步骤。但是我很困惑。每次我想在jupyter中使用某个环境进行开发时,我是否需要激活某个特定的环境?我还想nt想知道这个
未实现的错误是什么意思。我正在执行的步骤是否有错误?为什么不起作用?不,你总是使用Jupyter从env激活并启动Jupyter,然后你可以在记事本中选择你想用作内核的env。我尝试了这个解决方案,但不起作用。实际上,在这样做之后,只有我uck在当前情况下。不确定我哪里做错了。请检查控制面板环境变量中是否正确设置了python路径?
source activate test1
conda install ipykernel
ipython kernel install --name test1 --user