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

Better import error message #206

Closed
Xcelled opened this Issue Oct 14, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@Xcelled

Xcelled commented Oct 14, 2018

When running syncplay, I got Could not import GUI libraries. If you do not have PySide installed then you will need to install it for the GUI to work.

I think this is misleading for a few reasons:

  1. I'm running Python 3.6 (the default for Ubuntu Bionic), so I really needed to install PySide2
  2. I still received the same error even after installing PySide2. By executing the imports one at a time in the REPL, I discovered I also needed to install twisted, though of course the message didn't indicate this.

IMO, the error message shouldn't be hardcoded to tell the user to install a particular library for these reasons. A possible enhancement would be to bundle syncplay as a pip package, so said requirements can be automatically installed. (Plus, you could then just do pip install syncplay to install on all platforms)

@albertosottile

This comment has been minimized.

Member

albertosottile commented Oct 29, 2018

IMO, the error message shouldn't be hardcoded to tell the user to install a particular library for these > reasons.

I agree with you that importing and relative errors should be revised to pinpoint the actual package that is missing. The reason why that particular message is hardcoded is to allow the user to run Syncplay from the command line if some modules needed for the GUI are missing. As soon as I have time, I will try to give a look at the current import system for critical modules and create correct error messages.

A possible enhancement would be to bundle syncplay as a pip package, so said requirements can > be automatically installed.

Personally, I disagree with this solution. First of all, Syncplay is not a Python module but a stand-alone application, and AFAIK pip is not supposed to be used for this kind of projects. Also, pip is a tool closely related to Python development, and not many users are aware of it and of how to use it to install their software.

An alternative solution will be to provide some other kind of application package for Linux, as discussed in #199. Unfortunately, my latest comment did not receive any answer from Linux users. I encourage you to comment in that issue and provide your feedback there.

@albertosottile

This comment has been minimized.

Member

albertosottile commented Oct 29, 2018

Side note: you can also install PySide 1.x on Bionic and Python 3.6 with the python3-pyside package (https://packages.ubuntu.com/bionic/python3-pyside). As far as I know, PySide2 is not necessarily required on Linux on any version of Python, yet.

@Xcelled

This comment has been minimized.

Xcelled commented Oct 29, 2018

There's precedent for using pip to install "apps", eg https://github.com/nvbn/thefuck. Also setup.py provides a mechanism for registering python scripts as executables.

I'd make the argument that, since syncplay doesn't install required packages automatically, pip knowledge is still required to get syncplay running and that not leveraging setup.py's dependency mechanisms means that more pip knowledge is required. Case in point: I didn't know that PySide1.x was called python3-pyside. Sure, I could have looked it up, but that's beside the point.

I'm not saying that a pip package is the way to go, I'm just urging you not to discount it right away.

@albertosottile

This comment has been minimized.

Member

albertosottile commented Oct 29, 2018

I'd make the argument that, since syncplay doesn't install required packages automatically, pip
knowledge is still required to get syncplay running and that not leveraging setup.py's dependency
mechanisms means that more pip knowledge is required.

We had a similar discussion within the team during the introduction of PySide2. When I raised that very same argument, the general consensus was that Linux users install dependencies mainly through packages, and not using pip. Anyway, I encourage you to comment in #199 about this.

@Xcelled Xcelled referenced this issue Oct 29, 2018

Open

Flatpak and/or snap packages #199

0 of 2 tasks complete
@albertosottile

This comment has been minimized.

Member

albertosottile commented Oct 30, 2018

For the moment, I am fixing only the error message that shows if Twisted is missing. We will address the PySide error message as soon as PySide2 packages are commonly available for Linux. Thanks for reporting this.

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