gpt4 book ai didi

python - IPython notebook 命令返回错误

转载 作者:行者123 更新时间:2023-11-28 16:44:43 25 4
gpt4 key购买 nike

我是 Python 的新手,正在努力让 IPython(也是 numpy/scipy 包)在我的 Win7 机器上正常工作。我安装了 Python3.3,IDLE 工作,命令“ipython3”单独启动 ipython 环境,但是我无法启动笔记本。我收到以下错误消息。帮助将不胜感激。

C:\Users\Emre> ipython3 notebook Traceback (most recent call last):   
File "C:\Python33\Scripts\ipython3-script.py", line 9, in <module> load_entry_point('ipython==0.13.1', 'console_scripts', 'ipython3')()
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\frontend\terminal\ipapp.py", line 388, in launch_ new_instance app.initialize()
File "<string>", line 2, in initialize File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\config\application.py", line 84, in catch_config_ error return method(app, *args, **kwargs)
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\frontend\terminal\ipapp.py", line 313, in initial ize super(TerminalIPythonApp, self).initialize(argv) File "<string>", line 2, in initialize
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\config\application.py", line 84, in catch_config_ error return method(app, *args, **kwargs)
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\core\application.py", line 325, in initialize self.parse_command_line(argv)
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\frontend\terminal\ipapp.py", line 308, in parse_c ommand_line return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\config\application.py", line 84, in catch_config_ error return method(app, *args, **kwargs)
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\config\application.py", line 420, in parse_comman d_line return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\config\application.py", line 84, in catch_config_ error return method(app, *args, **kwargs)
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\config\application.py", line 352, in initialize_s ubcommand subapp = import_item(subapp)
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\utils\importstring.py", line 40, in import_item module = __import__(package,fromlist=[obj])
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\frontend\html\notebook\notebookapp.py", line 54, in <module>from .clustermanager import ClusterManager
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\frontend\html\notebook\clustermanager.py", line 2 7, in <module> from Python.parallel.apps.ipclusterapp import IPClusterStart
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\parallel\__init__.py", line 36, in <module>from .client.client import Client
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\parallel\client\client.py", line 46, in <module>from IPython.external.ssh import tunnel
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\external\ssh\tunnel.py", line 40, in <module>from IPython.external import pexpect
File "C:\Python33\lib\site-packages\ipython-0.13.1-py3.3.egg\IPython\external\pexpect\__init__.py", line 2, in <module>import pexpect
File "C:\Python33\lib\site-packages\pexpect-2.4-py3.3.egg\pexpect.py", line 82 except ImportError, e: ^ SyntaxError: invalid syntax

最佳答案

您已经在 Windows 上的 Python 3 上安装了 pexpect。这有两个问题:

  • pexpect 不适用于 Python 3
  • pexpect 不适用于 Windows

您应该卸载 pexpect (pip uninstall pexpect)。如果你想要 Python 3 中的预期功能,那么你需要 Python 3 兼容的分支 pexpect-u ,但这不适用于 Windows。

关于python - IPython notebook 命令返回错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15149075/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com