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
Make it possible to install ipython without nasty gui dependencies #2156
Comments
To clarify: isn't the issue really "provide a better error message"? It's already perfectly possible to install and use IPython without Qt. |
Without the Qt dependencies abrt will trigger a backtrace and users report the crash as error without seeing that they are missing PyQt4. So it will be "providing an error message instead of crashing", yes. |
The traceback is kind of long, but the message seems fine to me: $ ./ipython qtconsole
Traceback (most recent call last):
File "./ipython", line 10, in <module>
launch_new_instance()
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/ipapp.py", line 388, in launch_new_instance
app.initialize()
File "<string>", line 2, in initialize
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/ipapp.py", line 313, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/core/application.py", line 325, in initialize
self.parse_command_line(argv)
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/ipapp.py", line 308, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 420, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 352, in initialize_subcommand
subapp = import_item(subapp)
File "/usr/lib/python2.7/dist-packages/IPython/utils/importstring.py", line 40, in import_item
module = __import__(package,fromlist=[obj])
File "/usr/lib/python2.7/dist-packages/IPython/frontend/qt/console/qtconsoleapp.py", line 56, in <module>
from IPython.external.qt import QtCore, QtGui
File "/usr/lib/python2.7/dist-packages/IPython/external/qt.py", line 43, in <module>
raise ImportError('Cannot import PySide >= 1.0.3 or PyQt4 >= 4.7')
ImportError: Cannot import PySide >= 1.0.3 or PyQt4 >= 4.7 |
@tomspur: I think your complaint lies more with whomever packaged up your version of IPython. For example, in the current Debian release the from IPython.frontend.terminal.ipapp import launch_new_instance
try:
launch_new_instance()
except ImportError as e:
if "qt.console.qtconsoleapp" in e.message:
print "Could not start qtconsole. Please install ipython-qtconsole"
elif "html.notebook.notebookapp" in e.message:
print "Could not start notebook. Please install ipython-notebook"
else:
# if there is no clue on the cause -- just re-raise
raise |
@bfroehle I'm currently updating Fedora for 0.13, but the snipped you provided would perfectly fit for Fedora too. Thanks. The main reason for not doing downstream changes was to do the required changes upstream, so ipython will behave common on all platforms, if other distributions decide for the same splitting of the dependencies and this issue is meant to discuss about this case in general. The only difference currently is that the "ipython-qtconsole" package is named "ipython-gui" over here, based on the dependency on wxpython some times ago. |
Since different distributions will split IPython differently, how do you suggest that we handle this upstream? |
e.g. when you don't have ruby installed, Or what is the usual practice for missing dependencies, e.g. when there is no python3-matplotlib? Currently there would be a crash, so I hesitate to provide an python3-ipython package at the moment... |
It probably wouldn't cover misspellings like Matplotlib isn't a hard dependency for any frontend (for Debian packaging, ipython 'suggests' matplotlib). Trying to run with |
Furthermore, it seems to me that there isn't really anything we should/could be changing here. As you guys said above, given that each distro is free to split as it wishes and also names things differently, I'd rather the distros do what Debian did than us give a generic but invalid message, and one that would imply that there is a package manager that has the right dependencies to begin with. People can be on such an old distro that their package manager doesn't have a valid dep, and they must therefore do everything from source (assuming no root access). My vote is to close this as not being something really for us to fix. |
Ok. I still don't like downstream patches, but will do so :) Thanks. |
But the point here is: you want us to emit a message that says something about a 'distribution', but IPython can be installed outside of a distribution system (from source, by hand, on Solaris, on Windows, on AIX, etc). So by definition this has to be something you do downstream, since it's only true for a linux distro, and the IPython we produce encompasses systems beyond linux distros. |
I don't care that much to specifically tell the user which package (s)he needs to install. Searching for the missing command in the package manager is not really difficult. So a generic message like "Command not found, look if you have all the needed packages installed, provided in your distribution." would be fine for me. So I want to not let ipython completely crash, in case there is such a split of the package, not say something specific about this 'distribution'. |
If it's not going to run anyway, 'crashing' doesn't mean much, it's I think Fernando's point is that for us, an error message would have |
I guess the only thing that would make sense would be to simply strip out the full tracebacks and replace them with
Just so the user doesn't see all the internal frames. But that's about it... |
Currently, when installing only the console/core part of ipython without installing IPython/frontend/qt/, which in turn requires PyQt4 to be installed, "ipython qtconsole" crashes with "ImportError: No module named qt.console.qtconsoleapp".
(Same for notebook and the tornado dependency.)
But as many users of ipython just want to install/use the console without wanting to be forced to install qt it would be great, to catch such a traceback properly.
Possible solutions:
Or do you see another/better solution for such a case of unwanted dependencies?
The text was updated successfully, but these errors were encountered: