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 doesn't work with Qt 5.6 #3145

Closed
stonebig opened this issue Apr 30, 2016 · 13 comments
Closed

Spyder doesn't work with Qt 5.6 #3145

stonebig opened this issue Apr 30, 2016 · 13 comments

Comments

@stonebig
Copy link
Contributor

stonebig commented Apr 30, 2016

Description of your problem

What steps will reproduce the problem?

  1. pip install PyQt5.6 on Windows 7 64 / Python3.5 32 bit
  2. instal spyder master from github
  3. launch spyder

What is the expected output? What do you see instead?
spyder doesn't start well (but i see the initial splash screen).
Looking for a log of error but I don't find it

Please provide any additional information below
Did someone tried this already ? Is it supposed to work ?

Versions and main components

  • Spyder Version:spyder-3.0.0.dev0 of April 29th
  • Python Version: 3.5.1 32 bit
  • Operating system: Windows 7 64

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

@stonebig stonebig changed the title Qt5.6 and Spyder3.0.0dev0 of April 29th on Windows7 / Python3.5t Qt5.6 and Spyder3.0.0dev0 of April 29th on Windows7 / Python3.5 Apr 30, 2016
@stonebig
Copy link
Contributor Author

stonebig commented Apr 30, 2016

finally found it

Traceback (most recent call last):
  File "winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 24, in <module>
    from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: QtWebEngineWidgets must be imported before a QCoreApplication instance is created

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\app\spyder.py", line 3128, in main
    mainwindow = run_spyder(app, options, args)
  File "winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\app\spyder.py", line 3014, in run_spyder
    main.setup()
  File "winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\app\spyder.py", line 838, in setup
    from spyderlib.plugins.help import Help
  File "winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\plugins\help.py", line 21, in <module>
    from qtpy.QtWebEngineWidgets import QWebEnginePage
  File "winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 28, in <module>
    from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: No module named 'PyQt5.QtWebKitWidgets'

@stonebig
Copy link
Contributor Author

maybe the issue similar to this (and so PyQt5.6.0 issue ?): https://www.riverbankcomputing.com/pipermail/pyqt/2016-April/037406.html

@stonebig
Copy link
Contributor Author

this may be the core issue:

ImportError: QtWebEngineWidgets must be imported before a QCoreApplication instance is created

@stonebig
Copy link
Contributor Author

stonebig commented May 1, 2016

so, If I had a line "from qtpy.QtWebEngineWidgets import QWebEnginePage" in app/spyder.py line 91

#stonebig
from qtpy.QtWebEngineWidgets import QWebEnginePage
#==============================================================================
# Create our QApplication instance here because it's needed to render the
# splash screen created below
#==============================================================================
from spyderlib.utils.qthelpers import qapplication
MAIN_APP = qapplication()

I get further, but still crash:

Traceback (most recent call last):
  File "D:\WinPython\basedir35\buildQt5\winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\app\spyder.py", line 3129, in main
    mainwindow = run_spyder(app, options, args)
  File "D:\WinPython\basedir35\buildQt5\winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\app\spyder.py", line 3015, in run_spyder
    main.setup()
  File "D:\WinPython\basedir35\buildQt5\winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\app\spyder.py", line 840, in setup
    self.help = Help(self)
  File "D:\WinPython\basedir35\buildQt5\winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\plugins\help.py", line 359, in __init__
    self.rich_text = RichText(self)
  File "D:\WinPython\basedir35\buildQt5\winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\plugins\help.py", line 186, in __init__
    self.webview = FrameWebView(self)
  File "D:\WinPython\basedir35\buildQt5\winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\widgets\browser.py", line 263, in __init__
    self._webview.linkClicked.connect(self.linkClicked)
AttributeError: 'WebView' object has no attribute 'linkClicked'

@jitseniesen
Copy link
Member

Issue #3073 is also about QtWebKitWidgets (but on a Mac); the solution there was to downgrade qt5 to version 5.5.

@stonebig
Copy link
Contributor Author

stonebig commented May 1, 2016

that is not an option for me, as on Windows + Python3.5, I got only PyQt5.6.0.

@stonebig
Copy link
Contributor Author

stonebig commented May 1, 2016

I feel bad reading https://wiki.qt.io/Porting_from_QtWebKit_to_QtWebEngine.

Fix seems not so simple... I see an example in C++ there http://stackoverflow.com/questions/36446246/how-to-emulate-linkclickedqurl-signal-in-qwebengineview/36447833

this one in PyQt:
http://stackoverflow.com/questions/12240195/pyqt-webkit-and-html-forms-fetching-output-and-closing-window

this one seems clother
https://github.com/The-Compiler/qutebrowser/blob/master/qutebrowser/browser/webpage.py#l551

there seems to be a commit example here with the same need to switch away from "linkedClicked" qutebrowser/qutebrowser@c18027f

it's a GPL project, some may disagree I copy/Paste the code, and re-interpreting things to do are way over me

@stonebig
Copy link
Contributor Author

stonebig commented May 1, 2016

I can comment with a "#":

  • the 2 lines of "setLinkDelegationPolicy" and "ClickedLink" in plugin/help.py (line 481)
  • the 1 line of "ClickedLink" in widgets/browser.py (line 263).

No crash, but spyder do something then stop.

@stonebig stonebig changed the title Qt5.6 and Spyder3.0.0dev0 of April 29th on Windows7 / Python3.5 Qt5.6 and Spyder3.0.0dev0 of April 29th on Windows7 / Python3.5 (QtWebEngine replacing QtWebKit) May 1, 2016
@stonebig
Copy link
Contributor Author

stonebig commented May 2, 2016

File "D:\WinPython\basedir35\buildQt5\winpython-32bit-3.5.x.4\python-3.5.1\lib\site-packages\spyderlib\utils\qthelpers.py", line 242, in create_action
action.triggered.connect(triggered)
TypeError: decorated slot has no signature compatible with triggered(bool)

@ccordoba12 ccordoba12 added this to the v3.0beta3 milestone May 14, 2016
@ccordoba12 ccordoba12 changed the title Qt5.6 and Spyder3.0.0dev0 of April 29th on Windows7 / Python3.5 (QtWebEngine replacing QtWebKit) Spyder doesn't work with Qt 5.6 May 14, 2016
@ccordoba12
Copy link
Member

A pull request is coming to fix several problems we're having with Qt 5.6. They will be fixed for Spyder 3.0 beta3 :-)

@Nodd
Copy link
Contributor

Nodd commented May 30, 2016

Heh, I just upgraded my system, and 💣 ! Any news ?

@ccordoba12
Copy link
Member

A PR is coming :-)

El 30/05/16 a las 09:18, Joseph Martinot-Lagarde escribió:

Heh, I just upgraded my system, and 💣 ! Any news ?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#3145 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAWS7UFZm0-F6O6SkNn_mSpxWWYmLYiOks5qGvHKgaJpZM4ITaDG.

@davidovitch
Copy link
Contributor

davidovitch commented Jun 1, 2016

You can work around it by compiling PyQt 5.5.1 (I have the entire Qt 5.6 family installed system wide) and installing it in a virtual environment (downgrading my system Qt installation is too complex). On the bright side: now I know how to install multiple versions of PyQt in different virtualenvs :-)

edit: to be clear, you can compile PyQt 5.5.1 for you virtualenv while having Qt 5.6.0 installed system wide.

I've looked here for inspiration:

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

5 participants