启动IPython Notebook(Anaconda 3)时出现错误“%1不是有效的Win32应用程序”

时间:2015-07-27 03:20:22

标签: python ipython-notebook anaconda

一切如何开始......

我首先安装了Python 3(在Windows 8.1上)来学习Python。后来,我带了一个Python训练营,他们告诉我安装Anaconda,所以我做了。我后来才知道这是Python 2,所以我下载并安装了带有Python 3的Anaconda 3。

到目前为止,知道安装的软件包是多余的,也很混乱。所以今天我决定卸载所有Pythons(即独立的Python 3,Anaconda和Anaconda 3)。我用google搜索说明,似乎我需要做的就是通过控制面板中的“程序和功能”进行卸载。 现在,我重新安装了Anaconda 3,我能够从cmd和PyCharm运行.py文件。

问题:

当我尝试启动IPython Notebook时(我知道这是Anaconda发行版的一部分),它会给我以下错误消息,

PS C:\Users\myPC> ipython notebook
Traceback (most recent call last):
  File "C:\Users\myPC\Anaconda3\Scripts\ipython-script.py", line 5, in <module>
    sys.exit(start_ipython())
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 573, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 321, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\core\application.py", line 369, in initialize
    self.parse_command_line(argv)
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 316, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 471, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 402, in initialize_subcommand
    subapp = import_item(subapp)
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\utils\importstring.py", line 42, in import_item
    module = __import__(package, fromlist=[obj])
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\html\notebookapp.py", line 30, in <module>
    check_for_zmq('13', 'IPython.html')
  File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\utils\zmqrelated.py", line 10, in check_for_zmq
    import zmq
  File "C:\Users\myPC\AppData\Roaming\Python\Python34\site-packages\zmq\__init__.py", line 42, in <module>
    _libsodium = ctypes.cdll.LoadLibrary(bundled_sodium[0])
  File "C:\Users\myPC\Anaconda3\lib\ctypes\__init__.py", line 429, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\myPC\Anaconda3\lib\ctypes\__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

我搜索了这个错误消息,并且能够找到其他人发现类似错误的帖子,但是对于与启动IPython Notebook无关的不同情况。我尝试了一些建议的解决方案,但似乎都没有帮助我启动IPython Notebook。

在这一点上,我担心我可能会把它搞得更糟......

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我得到了IPython Notebook。我不确定幕后发生了什么,但这就是我所做的。

  1. 卸载Anaconda 3
  2. 重新安装了Anaconda 3(只是为了看看 在之前的重新安装中出现了问题。 毋庸置疑,我还是无法启动IPython Notebook)
  3. 安装Anaconda 3(这次, 32位;以前我曾经 处理64位Anaconda 3)
  4. 我能够从cmd
  5. 启动IPython Notebook

    出于某种原因,我有一种不好的感觉,我可能仍然把问题留在了未解决的地方;并可能在未来再次咬人。如果有人有什么建议(例如清理),我真的很感激!