AttributeError:模块“ ast”在Jupyter Notebook中没有属性“ AnnAssign”

时间:2019-04-21 08:36:13

标签: jupyter-notebook python-3.6 jupyter

我刚刚从macOS上的pip3安装了Jupyter。我遇到了一些问题,因此我使用export PATH="$HOME/Library/Python/3.6/bin:$PATH"解决了jupyter: command not found。现在,当我运行jupyter notebook时,我得到了:-

Traceback (most recent call last):
  File "/Users/sarthak/Library/Python/3.6/bin/jupyter-notebook", line 10, in <module>
    sys.exit(main())
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "</Users/sarthak/Library/Python/3.6/lib/python/site-packages/decorator.py:decorator-gen-7>", line 2, in initialize
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/notebook/notebookapp.py", line 1630, in initialize
    self.init_webapp()
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/notebook/notebookapp.py", line 1378, in init_webapp
    self.jinja_environment_options,
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/notebook/notebookapp.py", line 159, in __init__
    default_url, settings_overrides, jinja_env_options)
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/notebook/notebookapp.py", line 271, in init_settings
    nbextensions_path=jupyter_app.nbextensions_path,
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/notebook/notebookapp.py", line 1061, in nbextensions_path
    from IPython.paths import get_ipython_dir
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/IPython/terminal/embed.py", line 15, in <module>
    from IPython.core.interactiveshell import DummyMod, InteractiveShell
  File "/Users/sarthak/Library/Python/3.6/lib/python/site-packages/IPython/core/interactiveshell.py", line 119, in <module>
    _assign_nodes         = (ast.AugAssign, ast.AnnAssign, ast.Assign)
AttributeError: module 'ast' has no attribute 'AnnAssign'

python -V返回Python 2.7.10

0 个答案:

没有答案