加载Jupyter Notebook扩展时出错 [英] Error loading Jupyter Notebook Extensions
问题描述
我将Macbook与OS Sierra一起使用,并运行Python 3.6.1和Jupyter Notebook Server 5.0.0 我按照 https://github.com/ipython-contrib/jupyter_contrib_nbextensions上所述的说明安装了Jupyter Notebook扩展
I am using a Macbook with OS Sierra, and running Python 3.6.1 and Jupyter Notebook Server 5.0.0 I installed Jupyter Notebook extensions, following the instructions as mentioned on https://github.com/ipython-contrib/jupyter_contrib_nbextensions
虽然笔记本可以在我的系统上正常运行,但无法查看nbextensions选项卡.以下是我在终端上运行jupyter notebook
时看到的错误日志.我已经在SO上看到了一些相关问题,但它们似乎与安装特定扩展有关.
While the notebooks work fine on my system, I cannot view the nbextensions tab. The following is the error log I see on running jupyter notebook
in terminal. I have seen some related problems posted here on SO, but they seem to be about installing specific extensions.
此外,一种解决方案似乎是建议pip install jupyter_nbextensions_configurator
,但是从下面的输出可以看出,我已经安装了扩展程序.
Further, one of the solutions seemed to be suggest pip install jupyter_nbextensions_configurator
, but as can be seen from the output below, I already have the extension installed.
Requirement already satisfied: traitlets in /usr/local/lib/python3.6/site-packages (from jupyter_nbextensions_configurator)
Requirement already satisfied: tornado in /usr/local/lib/python3.6/site-packages (from jupyter_nbextensions_configurator)
但是,在日志中,您会注意到ModuleNotFoundError: No module named 'jupyter_nbextensions_configurator'
是错误消息之一.
However, in the logs, you will notice that ModuleNotFoundError: No module named 'jupyter_nbextensions_configurator'
is one of the error messages.
[W 08:44:49.973 NotebookApp] server_extensions is deprecated, use nbserver_extensions
[W 08:44:50.146 NotebookApp] Error loading server extension jupyter_nbextensions_configurator
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1271, in init_server_extensions
mod = importlib.import_module(modulename)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'jupyter_nbextensions_configurator'
[I 08:44:50.158 NotebookApp] Serving notebooks from local directory: /Users/sp
[I 08:44:50.158 NotebookApp] 0 active kernels
[I 08:44:50.158 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=c777a7ab5dc6cf416c238b7b37f58d10ebea9db0743b46ae
[I 08:44:50.158 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 08:44:50.163 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=c777a7ab5dc6cf416c238b7b37f58d10ebea9db0743b46ae
[I 08:44:51.633 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[W 08:44:54.407 NotebookApp] 404 GET /nbextensions/nbextensions_configurator/tree_tab/main.js?v=20170511084449 (::1) 25.76ms referer=http://localhost:8888/tree
我在这里想念什么?谢谢!
What am I missing here? Thanks!
推荐答案
我遇到了同样的问题.这是我解决的方法.
I had the same problem. Here is how I solved it.
我已经下载了Anaconda python版本3.7.我的系统上已经安装了Python 3.6.7.
I have downloaded Anaconda python version 3.7. I already had Python 3.6.7 on my system.
如果这样做,我会收到此错误:
I'd get this error if I did:
pip install jupyter_contrib_nbextensions
为了解决这个问题,我做到了:
To solve it, I did:
python3.7 -m pip install jupyter_contrib_nbextensions
我还没有尝试过,但这也可以解决您的问题:
I have not tried this, but this could solve your problem too:
conda install -c conda-forge jupyter_nbextensions_configurator
所以我想问题是由于系统上存在多个版本的Python. Anaconda使用的一种和正常点子"使用的一种可能不同.
So I guess the problem is because of there being multiple versions of Python on your system. The one which Anaconda uses and the one which the "normal pip" uses are probably different.
这篇关于加载Jupyter Notebook扩展时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!