无法再为 Python 编程打开 Spyder IDE

Ani*_*ani 6 python spyder

几个月前,作为 Anaconda ( https://www.continuum.io/downloads ) 的一部分,我在我的 Windows 7 笔记本电脑上安装了 Python 3.4 。我的安装包括 Spyder IDE,并且我已经成功地将 Spyder 用于 Python 编程。

但是,从昨天开始,我一直无法打开Spyder。我通常通过“开始”菜单打开 Spyder,但是现在,当我尝试单击“开始”菜单中的 Spyder 图标时,却没有任何响应。然后我尝试直接转到安装 Anaconda 的目录中 Scripts 文件夹中的 spyder.exe 文件。当我第一次点击这个时,下面的消息快速闪烁然后消失了:

Traceback (most recent call last):
  File "C:\Users\Aniket\Anaconda3\Scripts\spyder-script.py". line 2, in <module>
    start_app.main()
  File "C:\Users\Aniket\Anaconda3\lib\site-packages\spyderlib\start_app.py", line 114, in main
    from spyderlib import spyder
  File "C:\Users\Aniket\Anaconda3\lib\site-packages\spyderlib\spyder.py", line 100 in <module>
  File "C:\Users\Aniket\Anaconda3\lib\site-packages\spyderlib\qt\QtSvg.py", line 10 in <module>
    from PyQt4.QtSvg import * # analysis:ignore
ImportError:DLL load failed: The specified module could not be found
Run Code Online (Sandbox Code Playgroud)

我第二次双击 Spyder.exe,这一次,收到以下消息:

kfile.py", line 146 in lock
    symlinke(str(os.getpid()), self.name)
  File "C:\Users\Aniket\Anaconda3\lib\site-packages\spyderlib\utils\external\lockfile.py", line 87, in symlink
    os.rmdir(newlinkname)
OSError: [WinError 145] The directory is not empty: 'C:\\Users\\Aniket\\.spyder2-py3\\spyder.lock.1459432906109.newlink'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Aniket\Anaconda3\Scripts\spyder-script.py". line 2, in <module>
    start_app.main()
  File "C:\Users\Aniket\Anaconda3\lib\site-packages\spyderlib\start_app.py", line 106, in main
    from spyderlib import spyder
  File "C:\Users\Aniket\Anaconda3\lib\site-packages\spyderlib\spyder.py", line 100 in <module>
  File "C:\Users\Aniket\Anaconda3\lib\site-packages\spyderlib\qt\QtSvg.py", line 10 in <module>
    from PyQt4.QtSvg import * # analysis:ignore
ImportError:DLL load failed: The specified module could not be found
Run Code Online (Sandbox Code Playgroud)

这两条消息都非常迅速地闪烁然后消失了——当它们出现时,我通过快速按下 Print Screen 来捕捉它们。我不清楚错误消息的含义,也不清楚是什么导致了这种情况。有可能是我在某些功能运行时关闭了 Spyder,或者 Spyder 崩溃并导致一些持续性错误。有谁知道我该如何解决这个问题?

小智 6

我遇到了同样的问题。以下对我有用 请关闭 Spyder IDE,在 Anaconda Prompt 中运行

conda update spyder
Run Code Online (Sandbox Code Playgroud)

然后

spyder --reset
Run Code Online (Sandbox Code Playgroud)

重新启动Spyder


ram*_*ram 5

我遇到了 Spyder 2 无法启动的类似问题。我的安装是 Anaconda 的一部分,在 Win7 64 位操作系统上。我尝试了此处和此处列出的所有解决方案,但它们对我不起作用。在命令行中,尝试重置 spyder 时出现以下错误:

U:\>python -c "from spyderlib.spyder import main; main()" --reset
Traceback (most recent call last):
  File "C:\Temp\pApps\Anaconda3\lib\site-packages\spyderlib\qt\__init__.py", line 48, in <module> from PySide import __version__  # analysis:ignore
ImportError: No module named 'PySide'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Temp\pApps\Anaconda3\lib\site-packages\spyderlib\requirements.py", line 40, in check_qt from spyderlib import qt File "C:\Temp\pApps\Anaconda3\lib\site-packages\spyderlib\qt\__init__.py", line 50, in <module>
    raise ImportError("Spyder requires PySide or PyQt to be installed")
ImportError: Spyder requires PySide or PyQt to be installed

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Temp\pApps\Anaconda3\lib\site-packages\spyderlib\spyder.py", line 48, in <module> requirements.check_qt()
  File "C:\Temp\pApps\Anaconda3\lib\site-packages\spyderlib\requirements.py", line 50, in check_qt % (qt_infos['pyqt']+qt_infos['pyside']))
  File "C:\Temp\pApps\Anaconda3\lib\site-packages\spyderlib\requirements.py", line 25, in show_warning
    raise RuntimeError(message)
RuntimeError: Please check Spyder installation requirements:
PyQt4 4.6+ (or PySide 1.2.0+) is required.
Run Code Online (Sandbox Code Playgroud)

令我惊讶的是 spyder 一直工作到昨天,我昨天刚刚做了一个完整的更新如下:

conda update --all
Run Code Online (Sandbox Code Playgroud)

所以我今天再次更新了spyder,内容如下:

conda update spyder
Run Code Online (Sandbox Code Playgroud)

并向我展示了以下套餐计划:

The following packages will be UPDATED:

        spyder:     2.3.7-py35_3      None://None/<unknown> --> 2.3.8-py35_1
        spyder-app: 2.3.7-py35_0                            --> 2.3.8-py35_0

    The following packages will be DOWNGRADED due to dependency conflicts:

        matplotlib: 1.5.3-np111py35_1                       --> 1.5.1-np111py35_0
        pyqt:       5.6.0-py35_0                            --> 4.11.4-py35_7
        qt:         5.6.0-vc14_0                            [vc14] --> 4.8.7-vc14_9
         [vc14]
        qtconsole:  4.2.1-py35_2                            --> 4.2.1-py35_0
Run Code Online (Sandbox Code Playgroud)

更新后,spyder 现在可以正常工作了。本质上,我的问题是由于依赖冲突。


小智 0

我之前收到过完全相同的错误消息,我通过在 anaconda 下再次安装spyder来修复它:

conda install spyder
Run Code Online (Sandbox Code Playgroud)