Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder fails to launch with PySide on Windows #975

Closed
spyder-bot opened this issue Feb 17, 2015 · 5 comments
Closed

Spyder fails to launch with PySide on Windows #975

spyder-bot opened this issue Feb 17, 2015 · 5 comments

Comments

@spyder-bot
Copy link
Collaborator

From jed.lud...@gmail.com on 2012-03-22T11:29:36Z

What steps will reproduce the problem?

  1. Update to latest 2.2.0dev ( revision 46defadf01ae )
    1. Launch "bootstrap.py --gui pyside -- debug"

I tried this on more than one machine, and the behavior was the same on both. What is the expected output? What do you see instead? Spyder fails to launch. Traceback is:

c:\src\spyderlib>bootstrap.py --gui pyside -- debug
Executing Spyder from source checkout Revision 1945 :46defadf01ae, Branch: default

  1. Patched sys.path with C:\src\spyderlib
  2. Skipping GUI toolkit detection
    Traceback (most recent call last):
    File "C:\src\spyderlib\bootstrap.py", line 76, in
    from spyderlib import spyder
    File "C:\src\spyderlib\spyderlib\spyder.py", line 75, in
    from spyderlib.qt.QtGui import (QApplication, QMainWindow, QSplashScreen,
    File "C:\src\spyderlib\spyderlib\qt\QtGui.py", line 13, in
    from PySide.QtGui import *
    ImportError: DLL load failed: The specified procedure could not be found. Please use labels and text to provide additional information. I bisected the repository and found that revision ffbfa56f4872 is the source of the issue. I'll create a code review highlighting the offending line.

The problem shows up in spyder.py. First, line 31 requests an import of Spyder's qt module:

from spyderlib import qt

This is supposed to trigger Spyder's internal logic to import the right flavor of Qt. In previous revisions, this was accomplished by importing all of PySide right from the Spyder's qt module. Now the qt module doesn't really import much from PySide. It just sees if it can get a version number. Then at line 36:

requirements.check_qt()

The requirements checking process actually imports PyQt4.QtCore. The real root of the problem then comes at line 75 where QtGui is imported. What happens is that during the import of PySide.QtGui python finds that it already has a copy of QtCore imported, and it tries to use PyQt4.QtCore with PySide.QtGui, and everything falls apart from there. I verified this using Procmon.exe to watch the system search for modules and DLLs.

As a quick test, if I comment out the requirements check at line 36 of spyder.py, Spyder with PySide launches as expected. The import of PySide.QtGui triggers an import of PySide.QtCore as it should.

Windows 7
Python 2.7.2
Qt 4.7.4
PySide 1.1.0

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=975

@spyder-bot
Copy link
Collaborator Author

From techtonik@gmail.com on 2012-03-23T00:54:42Z

The https://code.google.com/p/spyderlib/source/browse/spyderlib/requirements.py#49 check_qt() should be modified to check spyderlib.qt.version - this will introduce dependency from spyderlib.qt, but we can fix that by version and binding flavor type explicitly from spyder.py

We also need to expose qt._modname with as a public API - something like qt.binding

@spyder-bot
Copy link
Collaborator Author

From techtonik@gmail.com on 2012-03-23T00:54:56Z

Status: Accepted

@spyder-bot
Copy link
Collaborator Author

From techtonik@gmail.com on 2012-03-23T02:32:03Z

WIP patch that should fix the issue, but leaves many questionable TODOs

Attachment: fix.qt.requirements.check.diff

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2012-03-23T08:14:01Z

Of course, the simple fix was to simply revert revision ffbfa56f4872 :). But I agree that the better approach is to improve Spyder's Qt proxy. Factoring in IPython's need for API #2 complicates matters a bit. It appears there are two design goals:

  1. Allow the user to select which PySide or PyQt. (Which should be default? Not sure PySide is ready yet to become the default.)
  2. Figure out which API version needs to be loaded based upon the needs of other packages and perhaps the user's desire to enforce a specific API version.

Ideally, all of this would be accomplished through importing only version information from the various packages. No actually imports of QtCore, QtGui, etc., should happen until after all the above options have been finalized at run time.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-03-25T14:29:01Z

This issue was updated by revision 9c4649090f0a .

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant