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

Support for Qt6 #20201

Open
mscheltienne opened this issue Dec 14, 2022 · 18 comments · May be fixed by #23055
Open

Support for Qt6 #20201

mscheltienne opened this issue Dec 14, 2022 · 18 comments · May be fixed by #23055

Comments

@mscheltienne
Copy link

mscheltienne commented Dec 14, 2022

I looked through the open and close issues, and could not find one related to support for Qt6.
Currently, Spyder does not support Qt6 bindings, PyQt6 and PySide6:

qt_infos = dict(pyqt5=("PyQt5", "5.9"), pyside2=("PySide2", "5.12"))

Do you plan on adding support/changing the default to a Qt6 binding, and on which timeline?

@ccordoba12
Copy link
Member

ccordoba12 commented Dec 15, 2022

Hey @mscheltienne, thanks for reporting. You said

Do you plan on adding support/changing the default to a Qt6 binding,

Yeah, we have to because Qt5 won't receive more updates (i.e. improvements and bugfixes) from the Qt company.

and on which timeline?

We don't have a specific timeline in mind yet, but probably the next year and a half or two years. The thing is we won't get a substantial benefit from moving to Qt6 right now nor most of our users, I'd say, in the sense that Spyder will continue working exactly the same with that new version.

Is there a particular reason you're asking for this?

@mscheltienne
Copy link
Author

Ok, thank you for the update.
MNE-Python is distributed with installers, similarly to Spyder; and despite extensive testing/time spent to theoretically make Qt5 and Qt6 live happily side-by-side, it's causing issues. And I think the last package bundled in the installers that does not support Qt6 is Spyder. For x-ref: mne-tools/mne-installers#163
It's also causing me some headaches from time to time when I'm developing a project using Qt6 (which is why for now I tend to stick to PyQt5 whenever possible).

@ccordoba12
Copy link
Member

ccordoba12 commented Dec 16, 2022

Ok, I see. The problem is we have limited resources and supporting a new Qt version usually takes a single, full time developer two or three months to do it.

@hoechenberger
Copy link

Thanks for your response, @ccordoba12!

cc @larsoner @drammock

@gvizkelethy
Copy link

One advantage of moving to Qt6 is to have native Spyder on M1. Right now Spyder only runs in emulation (Rosetta 2) mode. Actually, it works only with the prebuilt Spyder, Spyder cannot be installed with pip, it fails at the installation of PyQt5, which is obviously not available natively for the M1 site they do not develop this version anymore. On the other hand PqQt6 or PySide6 is available for the M1, we just need Spyder to use one of them.

@hoechenberger
Copy link

One advantage of moving to Qt6 is to have native Spyder on M1. Right now Spyder only runs in emulation (Rosetta 2) mode.

You can install a native build from conda-forge.

conda install --channel=conda-forge mamba
mamba install --override-channels --channel=conda-forge --name=spyder spyder

will install a native arm64 (M1) Spyder build into a newly-created spyder conda environment if you're on an Apple Silicon machine.

@ccordoba12
Copy link
Member

One advantage of moving to Qt6 is to have native Spyder on M1

Not true, as @hoechenberger clearly pointed out.

@gvizkelethy
Copy link

You are probably right, but I do not use Anaconda. I guess I just have to wait until PyQt6 is implemented in Spyder and use the emulation until.

@hoechenberger
Copy link

You are probably right, but I do not use Anaconda. I guess I just have to wait until PyQt6 is implemented in Spyder and use the emulation until.

You don't need to use Anaconda, just the conda package manager, But I do recognize that this is not always an option either.

@vaxxabait
Copy link

vaxxabait commented Sep 24, 2024

I can't find actual status of Qt6 support in Spyder.
This issue is not updated for a long time, however I've found
this:

pyqt5=("PyQt5", "5.15"),
pyside2=("PySide2", "5.15"),
pyqt6=("PyQt6", "6.5"),
pyside6=("PySide6", "6.5")

which suggests it should work.

Meanwhile to try Qt6 in Spyder I built QtPy with PySide6 support only.
With this, Spyder 6.0.1 does not start with the folowing error:

ImportError: cannot import name 'QTextCodec' from 'qtpy.QtCore'

Full log:
err.log

Could someone please specify whether Qt6 is fully supported by Spyder ?
If yes - which QtPy backed (PyQt6 or PySide6) must be used ?

@ccordoba12
Copy link
Member

Spyder 6 works with PyQt6 without issues. But there are still some problems we need to address for PySide6.

@dpizetta
Copy link
Contributor

Hi guys, there is any option to install Spyder v6 with the Qt6 by default? It works well with Qt6 (PyQt6) but after installing Spyder we need to remove Qt5 things because it is required by setup. The option --no-deps is not too useful since there are many other deps on Spyder. Any future provision to include PyQt6 to requirements? Or test if Qt is installed and skip Qt5 things to be installed? Thanks

@Nowa-Ammerlaan
Copy link

Hi guys, there is any option to install Spyder v6 with the Qt6 by default?

How are you installing spyder?

@dpizetta
Copy link
Contributor

Hi guys, there is any option to install Spyder v6 with the Qt6 by default?

How are you installing spyder?

Not sure if I understand the question, but using conda install spyder or pip install spyder if in a Python env. If you install it and then remove all the qt5 components, installing the qt6 ones, it works well.

@ccordoba12
Copy link
Member

Hi guys, there is any option to install Spyder v6 with the Qt6 by default?

There isn't one right now, sorry.

Any future provision to include PyQt6 to requirements? Or test if Qt is installed and skip Qt5 things to be installed?

I think we could add a spyder-base package in our Conda-forge feedstock (see conda-forge/spyder-feedstock#178), which would have all our dependencies with the exception of Qt5. Then you should be able to run

conda install -c conda-forge spyder-base pyqt=6

to get Spyder with Qt6.

For pip installations, I'm not sure if we could offer a [qt6] extra option. We'll see.

@ccordoba12 ccordoba12 modified the milestones: important, v6.1.0 Nov 18, 2024
@dpizetta
Copy link
Contributor

dpizetta commented Nov 19, 2024

For us the option with PIP is the most important one. Thanks for taking a look! And congratulations for Spyder 6, seems much more flexible!

I understand that it is not so simple to offer the option for PIP since imports have different names. Maybe using a pre_install function that checks weather any compatible binding is installed, if not, add to requirements the PyQt5.

@ccordoba12
Copy link
Member

For us the option with PIP is the most important one. Thanks for taking a look!

I took a look at it and it seems it's not possible unless we create a new package without Qt bindings (see here). But that's too much work for something that should be available in six months or so on PyPI, and in a few weeks on Conda-forge.

And congratulations for Spyder 6, seems much more flexible!

Thanks! Glad you liked it.

I understand that it is not so simple to offer the option for PIP since imports have different names. Maybe using a pre_install function that checks weather any compatible binding is installed, if not, add to requirements the PyQt5.

You're welcome to give it a try, but as far as I know pip doesn't allow to run code at installation time.

@dpizetta dpizetta linked a pull request Nov 22, 2024 that will close this issue
3 tasks
@dpizetta
Copy link
Contributor

Thanks @ccordoba12, the PR could be an option if it works for you. Let me know.

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

Successfully merging a pull request may close this issue.

7 participants