正如标题中所述,我在conda系统中遇到了jupyter的麻烦。
版本:
简而言之,我所做的是
source activate my_env1
pip install jupyter_contrib_nbextensions
# (I'm aware that I should have used conda install...)
jupyter contrib nbextension install --user
jupyter nbextension enable codefolding/main
jupyter contrib nbextensions migrate
pip install RISE
jupyter-nbextension install rise --py --sys-prefix
jupyter-nbextension enable rise --py --sys-prefix
请注意,在上述操作之前没有问题。
然后在“ my_env1”中运行jupyter notebook
并打开笔记本后,它无法通过以下消息连接内核:
ERROR:tornado.general:Uncaught exception in ZMQStream callback
Traceback (most recent call last):
File "***my_env1***/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "***my_env1***/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "***my_env1***/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
return self.dispatch_shell(stream, msg)
File "***my_env1***/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
self.pre_handler_hook()
File "** *my_env1***/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
self.saved_sigint_handler = signal(SIGINT, default_int_handler)
File "***my_env1***/lib/python3.6/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
在另一个表示为“ my_env2”的环境中,诸如jupyter XXX
之类的任何命令将因以下错误消息而暂停:
Traceback (most recent call last):
File "***my_env2***/bin/jupyter-notebook", line 4, in <module>
import notebook.notebookapp
File "***my_env2***/lib/python3.6/site-packages/notebook/__init__.py", line 25, in <module>
from .nbextensions import install_nbextension
File "***my_env2***/lib/python3.6/site-packages/notebook/nbextensions.py", line 31, in <module>
from .config_manager import BaseJSONConfigManager
ModuleNotFoundError: No module named 'notebook.config_manager'
~/.jupyter/jupyter_notebook_config.json
中的描述:
{
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"jupyter_nbextensions_configurator": true
}
}
}
但是,以下试验仍未解决。
pip install .
返回消息Failed to run bower: [Errno 2] No such file or directory: 'bower': 'bower'
(我想知道为什么它需要bower
而不尝试)我的问题很简单:
如果缺少信息,请通知我。谢谢。
我以前在同一anaconda3创建的另一个环境(例如my_env3)中使用过nbextension,当时没有问题。