Skip to content

Commit

Permalink
IPython console: Inform users that cloudpickle needs to be installed …
Browse files Browse the repository at this point in the history
…on external kernels
  • Loading branch information
ccordoba12 committed Nov 29, 2017
1 parent e473bbd commit 7712057
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
3 changes: 1 addition & 2 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ def test_np_threshold(main_window, qtbot):


@flaky(max_runs=3)
@pytest.mark.skipif(os.name == 'nt' or (PY2 and PYQT4),
reason="It times out sometimes on Windows and fails in PY2 and PyQt4")
@pytest.mark.skipif(os.name == 'nt', reason="It times out sometimes on Windows")
def test_change_types_in_varexp(main_window, qtbot):
"""Test that variable types can't be changed in the Variable Explorer."""
# Create object
Expand Down
24 changes: 14 additions & 10 deletions spyder/plugins/ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,20 +994,24 @@ def create_new_client(self, give_focus=True, filename=''):
# Else we won't be able to create a client
if not CONF.get('main_interpreter', 'default'):
pyexec = CONF.get('main_interpreter', 'executable')
ipykernel_present = programs.is_module_installed('ipykernel',
interpreter=pyexec)
if not ipykernel_present:
has_ipykernel = programs.is_module_installed('ipykernel',
interpreter=pyexec)
has_cloudpickle = programs.is_module_installed('cloudpickle',
interpreter=pyexec)
if not (has_ipykernel and has_cloudpickle):
client.show_kernel_error(_("Your Python environment or "
"installation doesn't "
"have the <tt>ipykernel</tt> module "
"installed on it. Without this module is "
"not possible for Spyder to create a "
"have the <tt>ipykernel</tt> and "
"<tt>cloudpickle</tt> modules "
"installed on it. Without these modules "
"is not possible for Spyder to create a "
"console for you.<br><br>"
"You can install <tt>ipykernel</tt> by "
"running in a terminal:<br><br>"
"<tt>pip install ipykernel</tt><br><br>"
"You can install them by running "
"in a system terminal:<br><br>"
"<tt>pip install ipykernel cloudpickle</tt>"
"<br><br>"
"or<br><br>"
"<tt>conda install ipykernel</tt>"))
"<tt>conda install ipykernel cloudpickle</tt>"))
return

self.connect_client_to_kernel(client)
Expand Down

0 comments on commit 7712057

Please sign in to comment.