spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.25k stars 1.6k forks source link

Use symbolic math restart kernels bug #21537

Closed popovs closed 2 months ago

popovs commented 10 months ago

Description

What steps will reproduce the problem?

Unchecked "Use symbolic math" and then clicked "apply and restart all kernels"

Traceback

Traceback (most recent call last):
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/spyder/plugins/ipythonconsole/widgets/client.py", line 772, in _restart_thread_main
    self.shellwidget.kernel_manager.restart_kernel(
  File "jupyter_core/utils/__init__.pyc", line 173, in wrapped
  File "asyncio/base_events.pyc", line 647, in run_until_complete
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/jupyter_client/manager.py", line 589, in _async_restart_kernel
    await self._async_shutdown_kernel(now=now, restart=True)
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/jupyter_client/manager.py", line 96, in wrapper
    raise e
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/jupyter_client/manager.py", line 87, in wrapper
    out = await method(self, *args, **kwargs)
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/jupyter_client/manager.py", line 547, in _async_shutdown_kernel
    await self._async_request_shutdown(restart=restart)
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/jupyter_client/manager.py", line 449, in _async_request_shutdown
    self._connect_control_socket()
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/jupyter_client/manager.py", line 366, in _connect_control_socket
    self._control_socket = self._create_connected_socket("control")
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/jupyter_client/connect.py", line 654, in _create_connected_socket
    sock = self.context.socket(socket_type)
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/zmq/sugar/context.py", line 359, in socket
    raise ZMQError(Errno.ENOTSUP)
zmq.error.ZMQError: Operation not supported

Versions

Dependencies

# Mandatory:
atomicwrites >=1.2.0             :  1.4.1 (OK)
chardet >=2.0.0                  :  5.2.0 (OK)
cloudpickle >=0.5.0              :  3.0.0 (OK)
cookiecutter >=1.6.0             :  2.4.0 (OK)
diff_match_patch >=20181111      :  20230430 (OK)
intervaltree >=3.0.2             :  3.1.0 (OK)
IPython >=8.13.0,<9.0.0,!=8.17.1 :  8.17.2 (OK)
jedi >=0.17.2,<0.20.0            :  0.19.1 (OK)
jellyfish >=0.7                  :  1.0.1 (OK)
jsonschema >=3.2.0               :  4.19.2 (OK)
keyring >=17.0.0                 :  24.2.0 (OK)
nbconvert >=4.0                  :  7.11.0 (OK)
numpydoc >=0.6.0                 :  1.6.0 (OK)
parso >=0.7.0,<0.9.0             :  0.8.3 (OK)
pexpect >=4.4.0                  :  4.8.0 (OK)
pickleshare >=0.4                :  0.7.5 (OK)
psutil >=5.3                     :  5.9.6 (OK)
pygments >=2.0                   :  2.16.1 (OK)
pylint >=2.5.0,<3.1              :  3.0.2 (OK)
pylint_venv >=3.0.2              :  None (OK)
pyls_spyder >=0.4.0              :  0.4.0 (OK)
pylsp >=1.9.0,<1.10.0            :  1.9.0 (OK)
pylsp_black >=1.2.0,<3.0.0       :  1.3.0 (OK)
qdarkstyle >=3.2.0,<3.3.0        :  3.2 (OK)
qstylizer >=0.2.2                :  0.2.2 (OK)
qtawesome >=1.2.1                :  1.2.3 (OK)
qtconsole >=5.5.0,<5.6.0         :  5.5.0 (OK)
qtpy >=2.1.0                     :  2.4.1 (OK)
rtree >=0.9.7                    :  1.1.0 (OK)
setuptools >=49.6.0              :  68.2.2 (OK)
sphinx >=0.6.6                   :  5.1.1 (OK)
spyder_kernels >=2.5.0,<2.6.0    :  2.5.0 (OK)
textdistance >=4.2.0             :  4.6.0 (OK)
three_merge >=0.1.1              :  0.1.1 (OK)
watchdog >=0.10.3                :  3.0.0 (OK)
zmq >=22.1.0                     :  25.1.1 (OK)

# Optional:
cython >=0.21                    :  3.0.5 (OK)
matplotlib >=3.0.0               :  3.8.1 (OK)
numpy >=1.7                      :  1.26.1 (OK)
pandas >=1.1.1                   :  2.1.2 (OK)
scipy >=0.17.0                   :  1.11.3 (OK)
sympy >=0.7.3                    :  1.12 (OK)
dalthviz commented 10 months ago

Hi @popovs thank you for the feedback! Not totally sure what could be happening for this to trigger. Checking the issue tracker, we have received some issues in the past with a similar traceback but we have not been able to reproduce it or get more info in order to understand what could be triggering the error.

Besides the symbolic math option change, could be this happening every time you restart a kernel? Are you able to trigger a kernel restart manually like for example via the Consoles menu (Consoles > Restart kernel)?

Any other info in order to reproduce this is greatly appreciated. Let us know!

ccordoba12 commented 10 months ago

@mrclary, could you check if you're seeing this error in our Mac app after following @popovs description above? Thanks!

mrclary commented 10 months ago

I do not see the error. I did observe some strange outputs in the console, however, when enabling symbolic math.

ipythonconsole2

mrclary commented 10 months ago

FYI, I was using Spyder's runtime environment for the IPython console. @popovs, please let us know if you are using an external environment.

dalthviz commented 2 months ago

Closing due to lack of response