我正在尝试运行Jupyter笔记本。我在Python 3.7版本中安装了Anaconda 5.3。笔记本启动,但内核无法运行,因为它指向我为某些ROS项目安装的另一个版本的Tornado(下面的输出)。如何确保Jupyter内核正在使用Anaconda路径中安装的Tornado?
[I 10:56:54.649 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
File "/dir/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/dir/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/dir/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py", line 16, in <module>
app.launch_new_instance()
File "/dir/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-123>", line 2, in initialize
File "/dir/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/dir/anaconda3/lib/python3.7/site-packages/ipykernel/kernelapp.py", line 467, in initialize
self.init_sockets()
File "/dir/anaconda3/lib/python3.7/site-packages/ipykernel/kernelapp.py", line 260, in init_sockets
self.init_iopub(context)
File "/dir/anaconda3/lib/python3.7/site-packages/ipykernel/kernelapp.py", line 268, in init_iopub
self.iopub_thread = IOPubThread(self.iopub_socket, pipe=True)
File "/dir/anaconda3/lib/python3.7/site-packages/ipykernel/iostream.py", line 66, in __init__
self.io_loop = IOLoop(make_current=False)
File "/dir/ros_projects/forked/rosbridge_suite/rosbridge_server/src/tornado/util.py", line 208, in __new__
instance.initialize(**args)
File "/dir/ros_projects/forked/rosbridge_suite/rosbridge_server/src/tornado/platform/epoll.py", line 26, in initialize
super(EPollIOLoop, self).initialize(impl=select.epoll(), **kwargs)
TypeError: initialize() got an unexpected keyword argument 'make_current'
[W 10:56:57.665 NotebookApp] KernelRestarter: restart failed
[W 10:56:57.666 NotebookApp] Kernel 2dd183ff-850d-4f79-945c-c8f56f1e695e died, removing from map.
答案 0 :(得分:0)
有点晚了,但回答了我自己的问题。 PYTHONPATH被设置用于许多其他项目。由于conda并未设置PYTHONPATH,因此运行
unset PYTHONPATH
成功了!