我用pip安装了jupiter并运行
jupyter notebook
然后我犯了这个错误:
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/notebook/notebookapp.py", line 1136, in initialize
super(NotebookApp, self).initialize(argv)
File "<decorator-gen-6>", line 2, in initialize
File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/jupyter_core/application.py", line 243, in initialize
self.migrate_config()
File "/Library/Python/2.7/site-packages/jupyter_core/application.py", line 162, in migrate_config
from .migrate import get_ipython_dir, migrate
File "/Library/Python/2.7/site-packages/jupyter_core/migrate.py", line 35, in <module>
from IPython.paths import get_ipython_dir
File "/Library/Python/2.7/site-packages/IPython/__init__.py", line 49, in <module>
from .terminal.embed import embed
File "/Library/Python/2.7/site-packages/IPython/terminal/embed.py", line 18, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/Library/Python/2.7/site-packages/IPython/terminal/interactiveshell.py", line 93, in <module>
class TerminalInteractiveShell(InteractiveShell):
File "/Library/Python/2.7/site-packages/IPython/terminal/interactiveshell.py", line 138, in TerminalInteractiveShell
highlighting: \n %s""" % ', '.join(get_all_styles())
File "/Library/Python/2.7/site-packages/pygments/styles/__init__.py", line 79, in get_all_styles
for name, _ in find_plugin_styles():
File "/Library/Python/2.7/site-packages/pygments/plugin.py", line 62, in find_plugin_styles
for entrypoint in iter_entry_points(STYLE_ENTRY_POINT):
File "/Library/Python/2.7/site-packages/pygments/plugin.py", line 45, in iter_entry_points
import pkg_resources
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/Library/Python/2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
任何人都知道如何修复它? 我在谷歌搜索过它,但在这个特定问题上没有任何帮助。
答案 0 :(得分:3)
我遇到了同样的问题,但只在我机器上的两个virtualenv之一。我在Python-2.7.9上运行的两个环境中都有最新的pip和相同版本的jupyter
在搜索更多内容后,我发现similar issue建议使用特定版本的setuptools
pip install setuptools==33.1.1
我的setuptools版本之前是setuptools-34.2.0。
答案 1 :(得分:0)
首先我使用python 2.7.10,这将调用错误。将python的版本更改为2.7.13并重新安装jupyter后,问题得到解决:)
可能很简单,但真的很有帮助!