3

我是 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
4

1 回答 1

3

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

  • pexpect 不适用于 Python 3
  • pexpect 在 Windows 上不起作用

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

于 2013-03-01T02:06:06.207 回答