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 is failing because of wrong qtpy version #3230

Closed
drammock opened this issue Jun 15, 2016 · 9 comments · Fixed by #3233
Closed

Spyder is failing because of wrong qtpy version #3230

drammock opened this issue Jun 15, 2016 · 9 comments · Fixed by #3233
Milestone

Comments

@drammock
Copy link

bootstrap.py no longer works on my system on current master.

What steps will reproduce the problem?

  1. python bootstrap.py

What is the expected output? What do you see instead?

Executing Spyder from source checkout
Revision 5f7f375, Branch: master
01. Patched sys.path with /home/drmccloy/Builds/spyder
02. PyQt4 is detected, selecting
03. Imported Spyder 3.0.0.dev0
    [Python 2.7.6 64bits, Qt 4.8.6, PyQt4 (API v2) 4.10.4 on Linux]
04. Running Spyder
Bootstrap completed in 00:00:00.4855
Traceback (most recent call last):
  File "/home/drmccloy/Builds/spyder/spyderlib/app/spyder.py", line 3142, in main
    mainwindow = run_spyder(app, options, args)
  File "/home/drmccloy/Builds/spyder/spyderlib/app/spyder.py", line 3028, in run_spyder
    main.setup()
  File "/home/drmccloy/Builds/spyder/spyderlib/app/spyder.py", line 842, in setup
    from spyderlib.plugins.help import Help
  File "/home/drmccloy/Builds/spyder/spyderlib/plugins/help.py", line 21, in <module>
    from qtpy.QtWebEngineWidgets import QWebEnginePage, WEBENGINE
ImportError: cannot import name WEBENGINE

Please provide any additional information below
The problem appears to have started with commit 4b21e1e ; after checking out the immediately prior commit I can load spyder again. Are you now relying on parts of Qt that are not in older versions? Has support for Qt 4.6+ been dropped entirely? The README still mentions it...

Versions and main components

Python 2.7.6 64bits, Qt 4.8.6, PyQt4 (API v2) 4.10.4 on Linux

Dependencies

jedi >=0.8.1 : 0.9.0 (OK)
matplotlib >=1.0: 1.5.1+1643.g0423430 (OK)
nbconvert >=4.0 : 4.2.0 (OK)
numpy >=1.7 : 1.12.0.dev0+2af06c8 (OK)
pandas >=0.13.1 : 0.18.0+104.g1c8816f (OK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 1.2.1 (OK)
pyflakes >=0.5.0: 1.1.0 (OK)
pygments >=1.6 : 2.1.3 (OK)
pylint >=0.25 : 1.5.5 (OK)
qtconsole >=4.0 : 4.2.1 (OK)
rope >=0.9.4 : 0.10.3 (OK)
sphinx >=0.6.6 : 1.5a0 (OK)
sympy >=0.7.3 : None (NOK)

@Nodd
Copy link
Contributor

Nodd commented Jun 15, 2016

You need to update qtpy.

@spyder-ide/core-developers We should maybe show qtpy version in the dependencies list ?

@drammock
Copy link
Author

drammock commented Jun 15, 2016

I see, it is a QtPy version issue not a Qt version issue. I confirm that
current master works after upgrading QtPy to 1.0.2. Still, the README does
not list a specific version of QtPy as a dependency, and the commit I
mentioned has effectively introduced a dependency of QtPy 1.0.2 (previously
I had 1.0.1). In my opinion bootstrap.py should also now do a QtPy
version check and throw a more informative error if the desired version is
not met.

@Nodd
Copy link
Contributor

Nodd commented Jun 15, 2016

You're right, the documentation is lacking. The switch to QtPy 1.0.2 is very recent and not everything has been updated.
Edit: The QtPy version is correctly set in setup.py. maybe bootstrap.py could check the dependencies from seteup.py on startup ?

@ccordoba12 ccordoba12 added this to the v3.0beta4 milestone Jun 15, 2016
@ccordoba12
Copy link
Member

ccordoba12 commented Jun 15, 2016

We should maybe show qtpy version in the dependencies list

I don't think it's worth it. Without the right qtpy version Spyder will simply fail (like in this case).

maybe bootstrap.py could check the dependencies from setup.py on startup

It'd take too much time because we have a lot of them. We can check just the qtpy version in bootstrap because it's so essential to have the right version of it :-) But for that we need qtpy 1.1 :-)

@ccordoba12 ccordoba12 changed the title spyder bootstrap.py failure Spyder is failing because of worng qtpy version Jun 15, 2016
@ccordoba12 ccordoba12 changed the title Spyder is failing because of worng qtpy version Spyder is failing because of wrong qtpy version Jun 15, 2016
@JohnRobson
Copy link

JohnRobson commented Jun 17, 2016

Please, fix the check_qt() function in /usr/lib/python3.5/site-packages/spyderlib/requirements.py

This function has this problem:

$ /usr/bin/python3.5 /usr/bin/spyder3
Traceback (most recent call last):
File "/usr/bin/spyder3", line 3, in
start.main()
File "/usr/lib/python3.5/site-packages/spyderlib/app/start.py", line 118, in main
from spyderlib.app import spyder
File "/usr/lib/python3.5/site-packages/spyderlib/app/spyder.py", line 48, in
requirements.check_qt()
File "/usr/lib/python3.5/site-packages/spyderlib/requirements.py", line 46, in check_qt
% (package_name, required_ver, actual_ver))
File "/usr/lib/python3.5/site-packages/spyderlib/requirements.py", line 25, in show_warning
raise RuntimeError(message)
RuntimeError: Please check Spyder installation requirements:
PyQt5 5.2+ is required (found v1.1.0.dev0).

But I already installed PyQt5 and qtpy:

$ sudo python -m pip install --upgrade PyQt5
Requirement already up-to-date: PyQt5 in /usr/lib/python3.5/site-packages
Requirement already up-to-date: sip in /usr/lib/python3.5/site-packages (from PyQt5)

$ sudo python -m pip install --upgrade qtpy (also python-qtpy-git python2-qtpy-git)
Requirement already up-to-date: qtpy in /usr/lib/python3.5/site-packages

I put a "return True" in this check_qt() and Spyder3 opened OK, but the console and ipython won't work, so the problem is this check_qt function, that found (found v1.1.0.dev0).

This function is confusing: PyQt5 (5.6) with QtPy (1.1.0.dev0)

My PIP List: http://paste.debian.net/739884/

@JohnRobson
Copy link

I changed line 38 (requirements.py):

from: qt_infos = dict(pyqt5=("PyQt5", "5.2"), pyqt=("PyQt4", "4.6"))
to: qt_infos = dict(pyqt5=("PyQt5", "1.1.0.dev0"), pyqt=("PyQt4", "4.6"))

After error: not find or load the Qt platform plugin "xcb".

I did: "export QT_QPA_PLATFORM_PLUGIN_PATH='/usr/lib/qt/plugins/platforms'"

But still with error:

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "/usr/lib/qt/plugins/platforms".

Available platform plugins are: wayland-org.kde.kwin.qpa (from /usr/lib/qt/plugins/platforms), eglfs (from /usr/lib/qt/plugins/platforms), linuxfb (from /usr/lib/qt/plugins/platforms), minimal (from /usr/lib/qt/plugins/platforms), minimalegl (from /usr/lib/qt/plugins/platforms), offscreen (from /usr/lib/qt/plugins/platforms), wayland-egl (from /usr/lib/qt/plugins/platforms), wayland (from /usr/lib/qt/plugins/platforms), xcb (from /usr/lib/qt/plugins/platforms), eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted (core dumped)

$ ls -lha /usr/lib/qt/plugins/platforms
total 1.4M
drwxr-xr-x 2 root root 4.0K Jun 16 01:47 .
drwxr-xr-x 56 root root 20K Jun 16 03:42 ..
-rwxr-xr-x 1 root root 415K Jun 14 06:56 KWinQpaPlugin.so
-rwxr-xr-x 1 root root 11K Jun 14 12:00 libqeglfs.so
-rwxr-xr-x 1 root root 335K Jun 14 12:00 libqlinuxfb.so
-rwxr-xr-x 1 root root 173K Jun 14 12:00 libqminimalegl.so
-rwxr-xr-x 1 root root 137K Jun 14 12:00 libqminimal.so
-rwxr-xr-x 1 root root 141K Jun 14 12:00 libqoffscreen.so
-rwxr-xr-x 1 root root 64K Jun 9 00:17 libqwayland-egl.so
-rwxr-xr-x 1 root root 11K Jun 9 00:17 libqwayland-generic.so
-rwxr-xr-x 1 root root 11K Jun 14 12:00 libqxcb.so

@ccordoba12
Copy link
Member

@JohnRobson, thanks for reporting your problems. My answers:

RuntimeError: Please check Spyder installation requirements:
PyQt5 5.2+ is required (found v1.1.0.dev0).

This error is caused because you're using qtpy master and Spyder needs to be updated to work with it. I'll create a PR to solve that problem as soon as I can.

not find or load the Qt platform plugin "xcb".

I don't know what distro you're using, but (I almost sure) you need to install libxcb for things to work correctly:

http://packages.ubuntu.com/trusty/libxcb1

By the way, the PyQt5 wheel is working fine for me with that package installed :-)

@JohnRobson
Copy link

not find or load the Qt platform plugin "xcb".

I solved this removing all PyQt4 and PyQt5 installed with "pip" and installing directly from archlinux aur packages "python-pyqt4 python-pyqt5 python2-pyqt4 python2-pyqt5".

PyQt5 5.2+ is required (found v1.1.0.dev0).

This one still wrong.

For now Spyder 2.3.9 is awesome... I excited to see a stable version for Spyder 3.

@iurisegtovich
Copy link

I had an issue that seems to match what happened here
But in my case the solution was to "sudo rm -rf user/anaconda3" and reinstall it with "bash anaconda....sh", because i had previously installed it using sudo ("sudo bash anaconda....sh")

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

Successfully merging a pull request may close this issue.

5 participants