无法再打开Spyder IDE进行Python编程

时间:2016-03-31 14:33:20

标签: python spyder

几个月前,我在Windows 7笔记本电脑上安装了Python 3.4,作为Anaconda(https://www.continuum.io/downloads)的一部分。我的安装包括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

我第二次双击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

这两条消息都快速闪烁然后消失了 - 我们在出现时快速按下Print Screen来捕获它们。我不清楚错误消息的含义,也不会导致错误消息。当一些函数运行时,我可能会关闭Spyder,或者Spyder崩溃并导致一些持久性错误。有谁知道我怎么解决这个问题?

6 个答案:

答案 0 :(得分:3)

我遇到了类似Spyder 2无法启动的问题。我的安装是Win7 64位操作系统上的Anaconda的一部分。我尝试了这里列出的所有解决方案和here,但它们对我不起作用。从命令行,我在尝试重置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.

让我感到惊讶的是,Spyder在昨天工作正常,我昨天刚刚完成了如下全面更新:

conda update --all

所以我今天再次通过以下内容更新了spyder:

conda update spyder

我提出了以下套餐计划: 以下包将更新:

    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

更新后,spyder现在运行正常。 从本质上讲,我的问题是由于依赖冲突。

答案 1 :(得分:3)

我知道这是一个老线程,但刚刚遇到同样的问题,我可以从https://github.com/spyder-ide/spyder/issues/3005

找到一个对我有用的答案

我的问题似乎是Spyder的状态仍在运行,因此无法打开。要解决此问题,您需要在Users \目录中查找名为.spyder2的目录,然后找到名为spyder.lock的文件并将其删除。

答案 2 :(得分:2)

几天前和你一样有同样的问题并重新安装工作,所以我去了:

C:\Users\'YourName'\\.spyder2-py3

删除每个spyder,锁定文件/文件夹并重新启动。

答案 3 :(得分:0)

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

conda install spyder

答案 4 :(得分:0)

好吧它说它缺少PyQt4.dll,您可以通过以下方式检查:在anaconda3目录中搜索pyqt4。 有几种可能性:

  • 它仍在:〜\ Anaconda3_x86 \ Library \ plugins \ designer

这意味着python无法找到,因为它不是在这个目录中搜索,我非常怀疑可能性,因为这意味着你已经调整了一些代码。

  • 它不在任何地方

也许你或者更有可能你的某个程序在每次事故中都删除了它?

  • 它不在:〜\ Anaconda3_x86 \ Library \ plugins \ designer

我也怀疑这种可能性,因为这意味着文件已被移动......

但是你可以通过重新安装xuwei提到的spyder来解决这个问题。

答案 5 :(得分:0)

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

conda update spyder

然后

spyder --reset

重新启动Spyder