spyder-ide / spyder

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

Random crash while restarting the kernel #22227

Closed y-aghnaj closed 4 months ago

y-aghnaj commented 4 months ago

Description

What steps will reproduce the problem?

Changed the pyhton interpreter from C:\Program Files\Spyder\python.exe

To C:\Program Files\Python312\python.exe

Traceback

Traceback (most recent call last):
  File "C:\Program Files\Spyder\pkgs\spyder\plugins\ipythonconsole\widgets\client.py", line 772, in _restart_thread_main
    self.shellwidget.kernel_manager.restart_kernel(
  File "C:\Program Files\Spyder\pkgs\jupyter_core\utils\__init__.py", line 165, in wrapped
    return loop.run_until_complete(inner)
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "C:\Program Files\Spyder\pkgs\jupyter_client\manager.py", line 589, in _async_restart_kernel
    await self._async_shutdown_kernel(now=now, restart=True)
  File "C:\Program Files\Spyder\pkgs\jupyter_client\manager.py", line 96, in wrapper
    raise e
  File "C:\Program Files\Spyder\pkgs\jupyter_client\manager.py", line 87, in wrapper
    out = await method(self, *args, **kwargs)
  File "C:\Program Files\Spyder\pkgs\jupyter_client\manager.py", line 547, in _async_shutdown_kernel
    await self._async_request_shutdown(restart=restart)
  File "C:\Program Files\Spyder\pkgs\jupyter_client\manager.py", line 449, in _async_request_shutdown
    self._connect_control_socket()
  File "C:\Program Files\Spyder\pkgs\jupyter_client\manager.py", line 366, in _connect_control_socket
    self._control_socket = self._create_connected_socket("control")
  File "C:\Program Files\Spyder\pkgs\jupyter_client\connect.py", line 654, in _create_connected_socket
    sock = self.context.socket(socket_type)
  File "C:\Program Files\Spyder\pkgs\zmq\sugar\context.py", line 350, in socket
    raise ZMQError(Errno.ENOTSUP)
zmq.error.ZMQError: 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.6.0 (OK)
diff_match_patch >=20181111   :  20230430 (OK)
intervaltree                  :  None (OK)
IPython >=8.12.2,<8.13.0      :  8.12.3 (OK)
jedi >=0.17.2,<0.20.0         :  0.19.1 (OK)
jellyfish >=0.7               :  1.0.4 (OK)
jsonschema >=3.2.0            :  4.22.0 (OK)
keyring >=17.0.0              :  25.2.1 (OK)
nbconvert >=4.0               :  7.16.4 (OK)
numpydoc >=0.6.0              :  1.7.0 (OK)
paramiko >=2.4.0              :  3.4.0 (OK)
parso >=0.7.0,<0.9.0          :  0.8.4 (OK)
pexpect >=4.4.0               :  4.9.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.8 (OK)
pygments >=2.0                :  2.18.0 (OK)
pylint >=3.1,<4               :  3.2.3 (OK)
pylint_venv >=3.0.2           :  3.0.3 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.11.0,<1.12.0        :  1.11.0 (OK)
pylsp_black >=2.0.0,<3.0.0    :  2.0.0 (OK)
qdarkstyle >=3.2.0,<3.3.0     :  3.2.3 (OK)
qstylizer >=0.2.2             :  0.2.3 (OK)
qtawesome >=1.3.1,<1.4.0      :  1.3.1 (OK)
qtconsole >=5.5.1,<5.6.0      :  5.5.2 (OK)
qtpy >=2.1.0                  :  2.4.1 (OK)
rtree >=0.9.7                 :  1.2.0 (OK)
setuptools >=49.6.0           :  70.0.0 (OK)
sphinx >=0.6.6                :  7.1.2 (OK)
spyder_kernels >=2.5.2,<2.6.0 :  2.5.2 (OK)
textdistance >=4.2.0          :  4.6.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog                      :  4.0.1 (OK)
zmq >=24.0.0                  :  26.0.3 (OK)

# Optional:
cython >=0.21                 :  3.0.10 (OK)
matplotlib >=3.0.0            :  3.7.5 (OK)
numpy >=1.7                   :  1.24.4 (OK)
pandas >=1.1.1                :  2.0.3 (OK)
scipy >=0.17.0                :  1.10.1 (OK)
sympy >=0.7.3                 :  1.12.1 (OK)

Environment

Environment ``` Package Version ----------------------------- -------------- alabaster 0.7.13 arrow 1.3.0 astroid 3.2.2 asttokens 2.4.1 attrs 23.2.0 autopep8 2.0.4 Babel 2.15.0 backcall 0.2.0 backports.tarfile 1.2.0 beautifulsoup4 4.12.3 binaryornot 0.4.4 black 24.4.2 bleach 6.1.0 certifi 2024.6.2 cffi 1.16.0 chardet 5.2.0 charset-normalizer 3.3.2 click 8.1.7 cloudpickle 3.0.0 colorama 0.4.6 comm 0.2.2 contourpy 1.1.1 cookiecutter 2.6.0 cryptography 42.0.8 cycler 0.12.1 Cython 3.0.10 debugpy 1.8.1 decorator 5.1.1 defusedxml 0.7.1 diff-match-patch 20230430 dill 0.3.8 docstring-to-markdown 0.15 docutils 0.20.1 et-xmlfile 1.1.0 executing 2.0.1 fastjsonschema 2.19.1 flake8 7.0.0 fonttools 4.53.0 idna 3.7 imagesize 1.4.1 importlib_metadata 7.1.0 importlib_resources 6.4.0 inflection 0.5.1 instaloader 4.12 ipykernel 6.29.4 ipython 8.12.3 isort 5.13.2 jaraco.classes 3.4.0 jaraco.context 5.3.0 jaraco.functools 4.0.1 jedi 0.19.1 jellyfish 1.0.4 Jinja2 3.1.4 joblib 1.4.2 jsonschema 4.22.0 jsonschema-specifications 2023.12.1 jupyter_client 8.6.2 jupyter_core 5.7.2 jupyterlab_pygments 0.3.0 keyring 25.2.1 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.5 matplotlib 3.7.5 matplotlib-inline 0.1.7 mccabe 0.7.0 mdurl 0.1.2 mistune 3.0.2 more-itertools 10.3.0 mpmath 1.3.0 mypy-extensions 1.0.0 nbclient 0.10.0 nbconvert 7.16.4 nbformat 5.10.4 nest-asyncio 1.6.0 nltk 3.8.1 numpy 1.24.4 numpydoc 1.7.0 openpyxl 3.1.3 packaging 24.1 pandas 2.0.3 pandocfilters 1.5.1 paramiko 3.4.0 parso 0.8.4 pathspec 0.12.1 pexpect 4.9.0 pickleshare 0.7.5 pillow 10.3.0 pip 24.1.1 pkgutil_resolve_name 1.3.10 platformdirs 4.2.2 pluggy 1.5.0 prompt_toolkit 3.0.47 psutil 6.0.0 ptyprocess 0.7.0 pure-eval 0.2.2 pycodestyle 2.11.1 pycparser 2.22 pydocstyle 6.3.0 pyflakes 3.2.0 Pygments 2.18.0 pylint 3.2.3 pylint-venv 3.0.3 pyls-spyder 0.4.0 pyparsing 3.1.2 PyQt5 5.15.10 PyQt5-Qt5 5.15.2 PyQt5-sip 12.13.0 PyQtWebEngine 5.15.6 PyQtWebEngine-Qt5 5.15.2 python-dateutil 2.9.0.post0 python-lsp-black 2.0.0 python-lsp-jsonrpc 1.1.2 python-lsp-server 1.11.0 pytoolconfig 1.3.1 pytz 2024.1 pywin32 306 pywin32-ctypes 0.2.2 pyxdg 0.28 PyYAML 6.0.1 pyzmq 26.0.3 QDarkStyle 3.2.3 qstylizer 0.2.3 QtAwesome 1.3.1 qtconsole 5.5.2 QtPy 2.4.1 referencing 0.35.1 regex 2024.5.15 requests 2.32.3 rich 13.7.1 rope 1.13.0 rpds-py 0.18.1 scipy 1.10.1 setuptools 70.0.0 six 1.16.0 snowballstemmer 2.2.0 sortedcontainers 2.4.0 soupsieve 2.5 Sphinx 7.1.2 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.1 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 spyder 5.5.5 spyder-kernels 2.5.2 stack-data 0.6.3 sympy 1.12.1 tabulate 0.9.0 text-unidecode 1.3 textdistance 4.6.2 three-merge 0.1.1 tinycss2 1.3.0 tomli 2.0.1 tomlkit 0.12.5 tornado 6.4.1 tqdm 4.66.4 traitlets 5.14.3 types-python-dateutil 2.9.0.20240316 typing_extensions 4.12.2 tzdata 2024.1 ujson 5.10.0 urllib3 2.2.1 vaderSentiment 3.3.2 watchdog 4.0.1 wcwidth 0.2.13 webencodings 0.5.1 whatthepatch 1.0.5 wheel 0.43.0 yapf 0.40.2 zipp 3.19.2 ```
ccordoba12 commented 4 months ago

Hey @y-aghnaj, thanks for reporting. What happens if you close and open Spyder again? Does the same error show up?

y-aghnaj commented 4 months ago

Hi Carlos

Thanks for your return I've tried to replicate the crash again, but to no avail. After I've reported the issue, I restarted Spyder, and it worked just fine. I still don't know what caused it, but I'll continue looking for it.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Carlos Cordoba @.> Sent: Friday, July 5, 2024 3:53:12 PM To: spyder-ide/spyder @.> Cc: y-aghnaj @.>; Mention @.> Subject: Re: [spyder-ide/spyder] Random crash while restarting the kernel (Issue #22227)

Hey @y-aghnajhttps://github.com/y-aghnaj, thanks for reporting. What happens if you close and open Spyder again? Does the same error show up?

— Reply to this email directly, view it on GitHubhttps://github.com/spyder-ide/spyder/issues/22227#issuecomment-2211017132, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BI4L47TUQ4O3WOCHQ2LUUL3ZK2XNRAVCNFSM6AAAAABKJI72BSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRGAYTOMJTGI. You are receiving this because you were mentioned.Message ID: @.***>

ccordoba12 commented 4 months ago

Ok, thanks for letting us know about it. In that case, I'm going to close this issue but please post a new comment in case the error appears for you again.