Skip to content

Conversation

@cbrnr
Copy link
Contributor

@cbrnr cbrnr commented Nov 3, 2020

My project MNELAB depends on qtpy because I would like to support both PyQt5 and PySide2. However, if no bindings are installed, the displayed error message could be more informative and tell users what to do (see e.g. the problem reported in cbrnr/mnelab#182). I've added explicit instructions how to install either PyQt5 or PySide2.

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 14, 2020

@goanpeca @altendky do you have time to review this minor change?

@altendky
Copy link
Contributor

I have no authority here but... I would tend to avoid explicit commands. If people don't know to run pip to install stuff then they probably won't be remembering to use venv/bin/pip (you do correctly do everything in an env, right? :]) or --user or apt install python3-pyqt5 or... etc.

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 14, 2020

I would assume that people know how to pip install stuff, but currently the problem is that they don't know that a package is missing.

@altendky
Copy link
Contributor

In which case they don't need to be given a command. I understand the interest in saying more than just 'not found'. Maybe something like This is usually caused by not having installed a compatible Qt wrapper. Maybe even include the list of compatible wrappers. (#217 happens to add a more explicit list (dict) of the supported wrappers) Or maybe link to https://github.com/spyder-ide/qtpy#requirements? Though then you can have a disconnect between the site and the installed version.

As a side note, I presently add extras_requires for the qt wrappers so people can install my packages like package[pyside2] to allow my package to specify whatever version restrictions etc it has for pyside2. Or package[pyqt5] for that option.

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 14, 2020

I agree, a command is not necessary, but I think the message should mention the wrappers explicitly to get people on the right track. Also, I would restrict the wrappers to PySide2 and PyQt5, because PyQt4 is old and deprecated.

Thanks for mentioning the extras_require thing, I haven't thought about that – that's a very good idea!

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 14, 2020

OK, I've removed the part about pip from the message.

@cbrnr cbrnr closed this Jan 12, 2021
@cbrnr cbrnr deleted the informative-error-message branch January 12, 2021 10:59
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 this pull request may close these issues.

2 participants