Ho installato ipython con 'pip install ipython [all]' come descritto nella pagina di installazione e ho anche installato le dipendenze di qtconsole con homebrew (qt, pyqt e sip). Tuttavia, quando provo a lanciare il qtconsole da terminale con 'ipython qtconsole', ricevo il seguente messaggio di errore:Perché IPython QtConsole non si avvia?
Traceback (most recent call last):
File "/Users/***/.virtualenvs/data-analysis/bin/ipython", line 11, in <module>
sys.exit(start_ipython())
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/config/application.py", line 563, in launch_instance
app.initialize(argv)
File "<string>", line 2, in initialize
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 321, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/core/application.py", line 381, in initialize
self.parse_command_line(argv)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 316, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/config/application.py", line 475, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/config/application.py", line 406, in initialize_subcommand
subapp = import_item(subapp)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/utils/importstring.py", line 42, in import_item
module = __import__(package, fromlist=[obj])
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/qt/console/qtconsoleapp.py", line 58, in <module>
from IPython.external.qt import QtCore, QtGui
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/external/qt.py", line 23, in <module>
QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
File "/Users/***/.virtualenvs/data-analysis/lib/python2.7/site-packages/IPython/external/qt_loaders.py", line 258, in load_qt
api_options))
ImportError:
Could not load requested Qt binding. Please ensure that
PyQt4 >= 4.7 or PySide >= 1.0.3 is available,
and only one is imported per session.
Currently-imported Qt library: None
PyQt4 installed: False
PySide >= 1.0.3 installed: False
Tried to load: ['pyside', 'pyqt']
cosa c'è di sbagliato qui? Qualsiasi aiuto sarebbe molto apprezzato.
Nota: simile al problema qui (http://stackoverflow.com/questions/25752315/error-loading-ipython-qtconsole?rq=1); quel thread, così come i commenti seguenti (grazie jihun!), suggeriscono che l'aggiunta di "export PYTHONPATH =/usr/local/lib/python2.7/site-packages: $ PYTHONPATH" a .bash_profile risolve il problema. – thereislight
Nota utile "Come installare PyQt4 su Windows" vedere qui - http://stackoverflow.com/questions/22640640/how-to-install-pyqt4-on-windows-using-pip – Grag2015