Windows中的iPython Notebook - 启动时出错

时间:2013-06-24 13:27:11

标签: windows ipython-notebook anaconda

我正拼命地让ipython笔记本在windows环境中工作。我安装了Continuum IO的Anaconda,这是一个科学的python发行版。我想使用ipython笔记本,但得到以下错误。终端中的ipython运行正常。有什么想法吗?

更新:如下所述,这是我系统上sys.path的输出。

['',
 'C:\\Anaconda\\scripts',
 'C:\\Anaconda\\lib\\site-packages\\distribute-0.6.45-py2.7.egg',
 'C:\\Anaconda',
 'C:\\Users\\btibert\\ C:\\Anaconda\\Scripts',
 'C:\\Anaconda\\python27.zip',
 'C:\\Anaconda\\DLLs',
 'C:\\Anaconda\\lib',
 'C:\\Anaconda\\lib\\plat-win',
 'C:\\Anaconda\\lib\\lib-tk',
 'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages',
 'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages\\Orange\\orng',
 'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages\\setuptools-0.6c11-py2.7.egg-info',
 'C:\\Anaconda\\lib\\site-packages',
 'C:\\Anaconda\\lib\\site-packages\\PIL',
 'C:\\Anaconda\\lib\\site-packages\\win32',
 'C:\\Anaconda\\lib\\site-packages\\win32\\lib',
 'C:\\Anaconda\\lib\\site-packages\\Pythonwin',
 'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages\\IPython\\extensions']

这是错误:

C:\Users\btibert>ipython notebook
Traceback (most recent call last):
  File "C:\Anaconda\Scripts\ipython-script.py", line 5, in <module>
    sys.exit(launch_new_instance())
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\terminal\ipapp.py", line 402, in
 launch_new_instance
    app.initialize()
  File "<string>", line 2, in initialize
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\terminal\ipapp.py", line 302, in
 initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\core\application.py", line 325, in initia
lize
    self.parse_command_line(argv)
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\terminal\ipapp.py", line 297, in
 parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 413, in pars
e_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 349, in init
ialize_subcommand
    subapp = import_item(subapp)
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\utils\importstring.py", line 40, in impor
t_item
    module = __import__(package,fromlist=[obj])
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\html\notebook\notebookapp.py", l
ine 34, in <module>
    from zmq.eventloop import ioloop
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\zmq\eventloop\__init__.py", line 3, in <module>
    from zmq.eventloop.ioloop import IOLoop
  File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\zmq\eventloop\ioloop.py", line 56, in <module>
    from zmq.eventloop.platform.auto import set_close_exec, Waker
ImportError: No module named platform.auto

2 个答案:

答案 0 :(得分:0)

知道sys.path是什么会很有帮助。您可以通过以下方式找到:

$ ipython

In [1]: import sys

In [2]: sys.path

然后在这里分享输出。接下来,您要检查此目录中的文件:

C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\zmq\eventloop\platform

理想情况下,你会在那里看到auto.py,如果C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages在你的sys.path中,那么为什么它不起作用是一个谜,但如果那个文件不存在,目录不存在,或site-packages的路径不在sys.path中,那么需要先解决这些目录。

告诉我们,我们可以尝试从那里拿走它!

答案 1 :(得分:0)

我找到了解决这个问题的方法之一。我真的不认为我必须得到这个级别,但我完全卸载了我能找到的每个可能的python实例。我

  1. unisntalled Anaconda CE
  2. 删除了PATH
  3. 中对python的每个引用
  4. 编辑我的注册表以清除python数据(但确实留下了Python文件夹)
  5. 从@IanSR
  6. 上面列出的App / Roaming路径中删除了python

    基本上,我删除了所有可能的python引用,然后重新安装了Anaconda CE。瞧,Anaconda安装(看来)已经按照经销商的意图运作。