Skip to content
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

Can't restart kernel due to content in stderr file #17252

Closed
10 tasks done
mmagnuski opened this issue Jan 27, 2022 · 18 comments · Fixed by #17274
Closed
10 tasks done

Can't restart kernel due to content in stderr file #17252

mmagnuski opened this issue Jan 27, 2022 · 18 comments · Fixed by #17274

Comments

@mmagnuski
Copy link

mmagnuski commented Jan 27, 2022

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda (kind of, I use the latest miniconda)
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Hi, I have been trying for some time to set up Spyder in a separate conda environment to the env I'm working in (to avoid conflicts). Currently I have installed Spyder 5.2.2 from conda-forge in my base environment, and set the Python interpreter in Preferences to another environment called mne. I'm having an issue that seems to be similar to #17042 - I can't restart the kernel of the Spyder console (nothing happens if I try).

I also get "System nie może odnaleźć określonej ścieżki." (which means "System cannot find specified path") when the console starts, but I can write in the console after that.
Resetting preferences fixes the problem, but it also changes the Python interpreter to the one that I don't want to use (base env).

What steps reproduce the problem?

  1. Install spyder in a separate conda environment wrt the environemnt used for Spyder Python interpreter.
  2. Open spyder.
  3. Create any variable in the console (this step is not necessary).
  4. Choose "Restart kernel" option from the console "hambrger icon".
  5. Accept by pressing "OK".
  6. Nothing happens, the console still contains previous commands and the created variable is still present in the Variable Explorer. Any subsequent commands typed to the console also take effect as if the restart was ignored.

Versions

  • Spyder version: 5.2.2
  • Python version: 3.9.5
  • Qt version: 5.12.9
  • PyQt version: 5.12.3
  • Operating System name/version: Windows 10

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.0 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.6.0;<8.0.0        :  7.31.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.4.0 (OK)
keyring >=17.0.0              :  21.2.1 (OK)
nbconvert >=4.0               :  6.4.0 (OK)
numpydoc >=0.6.0              :  1.2 (OK)
paramiko >=2.4.0              :  2.9.2 (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.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0                :  2.12.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.3.2;<1.4.0          :  1.3.3 (OK)
pylsp_black >=1.0.0           :  1.0.1 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.2.1;<5.3.0      :  5.2.2 (OK)
qtpy >=1.5.0                  :  2.0.0 (OK)
rtree >=0.9.7                 :  None (NOK)
setuptools >=49.6.0           :  60.5.0 (OK)
sphinx >=0.6.6                :  4.3.2 (OK)
spyder_kernels >=2.2.1;<2.3.0 :  2.2.1 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=2.0.0            :  3.5.0 (OK)
numpy >=1.7                   :  1.21.2 (OK)
pandas >=1.1.1                :  1.3.5 (OK)
scipy >=0.17.0                :  1.7.3 (OK)
sympy >=0.7.3                 :  None (NOK)
@mmagnuski
Copy link
Author

BTW, I can start a new console without problems ("hamburger" menu of the console -> New console).

@ccordoba12
Copy link
Member

Hey @mmagnuski, thanks for reporting. This is very strange indeed, but I don't think it's related to issue #17042.

@dalthviz, could you check if this the case in a fresh conda-forge environment, using Python 3.9 on Windows? Thanks!

@mmagnuski
Copy link
Author

Hi @ccordoba12, thanks for responding. Could it be that something is wrong with the environment that I use as the Python interpreter in Spyder? BTW, I've tested this with a fresh conda-forge Spyder env and I get the same problem.

@dalthviz
Copy link
Member

dalthviz commented Jan 28, 2022

Hi @ccordoba12 @mmagnuski I checked creating a new env with conda-forge for the Spyder installation and setting a custom interpreter but the restart is working for me.

@mmagnuski could you post here your custom interpreter env to check it? Also, could you run spyder in debug mode (from an Anaconda prompt run spyder --debug-info verbose or use the option at File > Restart in debug mode > Verbose)?

Maybe when doing the restart a traceback could be getting logged which could help us understand better what is happening in your case. Just in case, if you run the debug option from the interface, the file with the log should end up located at the spyder config directory under your user directory, something like C:\Users\<your user>\.spyder-py3\spyder-debug.log.

Let us know!

@ccordoba12
Copy link
Member

I checked creating a new env with conda-forge for the Spyder installation and setting a custom interpreter but the restart is working for me.

@dalthviz, what happens if you use the default interpreter instead? I mean, the same interpreter as the one in the environment you created?

@dalthviz
Copy link
Member

@ccordoba12 it restarts:
imagen

@mmagnuski
Copy link
Author

Thanks for directions @dalthviz @ccordoba12!

could you post here your custom interpreter env to check it?

This is the output of conda list for the env used for Python Interpreter:

output of conda list
# packages in environment at C:\Users\Admin\.conda\envs\mne:
#
# Name                    Version                   Build  Channel
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
apptools                  5.1.0              pyh44b312d_0    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
black                     21.12b0            pyhd8ed1ab_0    conda-forge
blosc                     1.21.0               h0e60522_0    conda-forge
borsar                    0.1.dev1                  dev_0    <develop>
brotli                    1.0.9                h8ffe710_6    conda-forge
brotli-bin                1.0.9                h8ffe710_6    conda-forge
brotlipy                  0.7.0           py39hb82d6ee_1003    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
c-blosc2                  2.0.4                h09319c2_1    conda-forge
ca-certificates           2021.10.8            h5b45459_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
certifi                   2021.10.8        py39hcbf5309_1    conda-forge
cffi                      1.15.0           py39h0878f49_0    conda-forge
cfitsio                   4.0.0                hd67004f_0    conda-forge
charls                    2.2.0                h39d44d4_0    conda-forge
charset-normalizer        2.0.10             pyhd8ed1ab_0    conda-forge
click                     8.0.3            py39hcbf5309_1    conda-forge
cloudpickle               2.0.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
configobj                 5.0.6                      py_0    conda-forge
cryptography              36.0.1           py39h7bc7c5c_0    conda-forge
curl                      7.81.0               h789b8ee_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cytoolz                   0.11.2           py39hb82d6ee_1    conda-forge
dask-core                 2022.1.0           pyhd8ed1ab_0    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
debugpy                   1.5.1            py39h415ef7b_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
deprecated                1.2.13             pyh6c4a22f_0    conda-forge
dipy                      1.4.1            py39hb0a1f21_0    conda-forge
double-conversion         3.1.7                h0e60522_0    conda-forge
eigen                     3.4.0                h2d74725_0    conda-forge
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
envisage                  6.0.1              pyhd8ed1ab_0    conda-forge
executing                 0.8.2              pyhd8ed1ab_0    conda-forge
expat                     2.4.3                h39d44d4_0    conda-forge
ffmpeg                    4.3.1                ha925a31_0    conda-forge
fonttools                 4.29.0           py39hb82d6ee_0    conda-forge
freetype                  2.10.4               h546665d_1    conda-forge
fsspec                    2022.1.0           pyhd8ed1ab_0    conda-forge
giflib                    5.2.1                h8d14728_2    conda-forge
gl2ps                     1.4.2                h0597ee9_0    conda-forge
glew                      2.1.0                h39d44d4_2    conda-forge
h5py                      3.2.1           nompi_py39hf27771d_100    conda-forge
hdf4                      4.2.15               h0e5069d_3    conda-forge
hdf5                      1.10.6          nompi_h5268f04_1114    conda-forge
icu                       68.2                 h0e60522_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
imagecodecs               2021.11.20       py39he391c9c_1    conda-forge
imageio                   2.13.5             pyh239f2a4_0    conda-forge
imageio-ffmpeg            0.4.5              pyhd8ed1ab_0    conda-forge
importlib-metadata        4.10.1           py39hcbf5309_0    conda-forge
importlib_metadata        4.10.1               hd8ed1ab_0    conda-forge
importlib_resources       5.4.0              pyhd8ed1ab_0    conda-forge
ipykernel                 6.7.0            py39h832f523_0    conda-forge
ipython                   8.0.1            py39hcbf5309_0    conda-forge
jbig                      2.1               h8d14728_2003    conda-forge
jedi                      0.18.1           py39hcbf5309_0    conda-forge
joblib                    1.1.0              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h8ffe710_0    conda-forge
jsoncpp                   1.9.4                h2d74725_3    conda-forge
jupyter_client            7.1.2              pyhd8ed1ab_0    conda-forge
jupyter_core              4.9.1            py39hcbf5309_1    conda-forge
jxrlib                    1.1                  h8ffe710_2    conda-forge
kiwisolver                1.3.2            py39h2e07f2f_1    conda-forge
krb5                      1.19.2               h20d022d_3    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      3.0                  h0e60522_0    conda-forge
libaec                    1.0.6                h39d44d4_0    conda-forge
libblas                   3.9.0           13_win64_openblas    conda-forge
libbrotlicommon           1.0.9                h8ffe710_6    conda-forge
libbrotlidec              1.0.9                h8ffe710_6    conda-forge
libbrotlienc              1.0.9                h8ffe710_6    conda-forge
libcblas                  3.9.0           13_win64_openblas    conda-forge
libclang                  11.1.0          default_h5c34c98_1    conda-forge
libcurl                   7.81.0               h789b8ee_0    conda-forge
libdeflate                1.8                  h8ffe710_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libflang                  5.0.0           h6538335_20180525    conda-forge
libiconv                  1.16                 he774522_0    conda-forge
liblapack                 3.9.0           13_win64_openblas    conda-forge
libnetcdf                 4.8.1           nompi_hf689e7d_100    conda-forge
libogg                    1.3.4                h8ffe710_1    conda-forge
libopenblas               0.3.18          pthreads_hc469a61_0    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libsodium                 1.0.18               h8d14728_1    conda-forge
libspatialindex           1.9.3                h6c2663c_0
libssh2                   1.10.0               h680486a_2    conda-forge
libtheora                 1.1.1             h8d14728_1005    conda-forge
libtiff                   4.3.0                hd413186_2    conda-forge
libwebp-base              1.2.2                h8ffe710_1    conda-forge
libxml2                   2.9.12               hf5bbc77_1    conda-forge
libzip                    1.8.0                hfed4ece_1    conda-forge
libzlib                   1.2.11            h8ffe710_1013    conda-forge
libzopfli                 1.0.3                h0e60522_0    conda-forge
llvm-meta                 5.0.0                         0    conda-forge
llvmlite                  0.36.0           py39h34b8924_4
locket                    0.2.0                      py_2    conda-forge
loguru                    0.5.3            py39hcbf5309_3    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
matplotlib                3.5.1            py39hcbf5309_0    conda-forge
matplotlib-base           3.5.1            py39h581301d_0    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mayavi                    4.7.2            py39h342a29d_5    conda-forge
mffpy                     0.6.3              pyhd8ed1ab_0    conda-forge
mne                       0.24.1               hd8ed1ab_1    conda-forge
mne-base                  0.24.1             pyhd8ed1ab_1    conda-forge
mne-qt-browser            0.1.7              pyhd8ed1ab_0    conda-forge
mock                      4.0.3            py39hcbf5309_2    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy_extensions           0.4.3            py39hcbf5309_4    conda-forge
nest-asyncio              1.5.4              pyhd8ed1ab_0    conda-forge
networkx                  2.6.3              pyhd8ed1ab_1    conda-forge
nibabel                   3.2.1              pyhd8ed1ab_0    conda-forge
nilearn                   0.8.1              pyhd8ed1ab_0    conda-forge
nomkl                     1.0                  h5ca1d4c_0    conda-forge
numba                     0.53.1           py39hb8cd55e_1    conda-forge
numexpr                   2.8.0           py39h5ea59f0_100    conda-forge
numpy                     1.22.1           py39h6331f09_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openjpeg                  2.4.0                hb211442_1    conda-forge
openmp                    5.0.0                    vc14_1    conda-forge
openssl                   1.1.1l               h8ffe710_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pandas                    1.4.0            py39h2e25243_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
partd                     1.2.0              pyhd8ed1ab_0    conda-forge
pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
patsy                     0.5.2              pyhd8ed1ab_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    8.4.0            py39h916092e_0    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
platformdirs              2.3.0              pyhd8ed1ab_0    conda-forge
pooch                     1.6.0              pyhd8ed1ab_0    conda-forge
proj                      8.2.0                h1cfcee9_0    conda-forge
prompt-toolkit            3.0.24             pyha770c72_0    conda-forge
psutil                    5.9.0            py39hb82d6ee_0    conda-forge
pugixml                   1.11.4               h0e60522_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydicom                   2.2.2              pyh6c4a22f_0    conda-forge
pyface                    7.3.0              pyh44b312d_1    conda-forge
pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
pylabianca                0.1.0                     dev_0    <develop>
pyopenssl                 21.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.7              pyhd8ed1ab_0    conda-forge
pyqt                      5.12.3           py39hcbf5309_8    conda-forge
pyqt-impl                 5.12.3           py39h415ef7b_8    conda-forge
pyqt5-sip                 4.19.18          py39h415ef7b_8    conda-forge
pyqtchart                 5.12             py39h415ef7b_8    conda-forge
pyqtgraph                 0.12.3             pyhd8ed1ab_0    conda-forge
pyqtwebengine             5.12.1           py39h415ef7b_8    conda-forge
pyreadline                2.1             py39hcbf5309_1005    conda-forge
pysocks                   1.7.1            py39hcbf5309_4    conda-forge
pysurfer                  0.11.0                     py_0    conda-forge
pytables                  3.6.1            py39h42e6cd8_3    conda-forge
python                    3.9.9           h9a09f29_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-picard             0.7                pyh8a188c0_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.3             pyhd8ed1ab_0    conda-forge
pyvista                   0.33.2             pyhd8ed1ab_0    conda-forge
pyvistaqt                 0.7.0              pyhd8ed1ab_0    conda-forge
pywavelets                1.2.0            py39h5d4886f_1    conda-forge
pywin32                   303              py39hb82d6ee_0    conda-forge
pyyaml                    6.0              py39hb82d6ee_3    conda-forge
pyzmq                     22.3.0           py39he46f08e_1    conda-forge
qt                        5.12.9               h5909a2a_4    conda-forge
qtpy                      2.0.0              pyhd8ed1ab_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
rtree                     0.9.7            py39h2eaa2aa_1
sarna                     0.1.dev1                  dev_0    <develop>
scikit-image              0.19.1           py39h2e25243_0    conda-forge
scikit-learn              1.0.2            py39he931e04_0    conda-forge
scipy                     1.7.3            py39hc0c34ad_0    conda-forge
scooby                    0.5.11             pyhd8ed1ab_0    conda-forge
seaborn                   0.11.2             pyhd3eb1b0_0
setuptools                60.5.0           py39hcbf5309_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.8                ha925a31_3    conda-forge
spyder-kernels            2.2.1            py39hcbf5309_0    conda-forge
sqlite                    3.37.0               h8ffe710_0    conda-forge
stack_data                0.1.4              pyhd8ed1ab_0    conda-forge
statsmodels               0.13.1           py39h5d4886f_0    conda-forge
tbb                       2020.2               h2d74725_4    conda-forge
tbb-devel                 2020.2               h2d74725_4    conda-forge
threadpoolctl             3.0.0              pyh8a188c0_0    conda-forge
tifffile                  2021.11.2          pyhd8ed1ab_0    conda-forge
tk                        8.6.11               h8ffe710_1    conda-forge
tomli                     1.2.2              pyhd8ed1ab_0    conda-forge
toolz                     0.11.2             pyhd8ed1ab_0    conda-forge
tornado                   6.1              py39hb82d6ee_2    conda-forge
tqdm                      4.62.3             pyhd8ed1ab_0    conda-forge
traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
traits                    6.3.2            py39hb82d6ee_0    conda-forge
traitsui                  7.2.0              pyhd8ed1ab_0    conda-forge
typed-ast                 1.5.2            py39hb82d6ee_0    conda-forge
typing-extensions         4.0.1                hd8ed1ab_0    conda-forge
typing_extensions         4.0.1              pyha770c72_0    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
unicodedata2              14.0.0           py39hb82d6ee_0    conda-forge
urllib3                   1.26.8             pyhd8ed1ab_1    conda-forge
utfcpp                    3.2.1                h57928b3_0    conda-forge
vc                        14.2                 hb210afc_6    conda-forge
vs2015_runtime            14.29.30037          h902a5da_6    conda-forge
vtk                       9.0.3           no_osmesa_py39h7ab63fb_106    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
win32_setctime            1.1.0              pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0            py39hcbf5309_3    conda-forge
wrapt                     1.13.3           py39hb82d6ee_1    conda-forge
xarray                    0.20.1             pyhd3eb1b0_1
xlrd                      2.0.1              pyhd8ed1ab_3    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge
zeromq                    4.3.4                h0e60522_1    conda-forge
zfp                       0.5.5                h0e60522_8    conda-forge
zipp                      3.7.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h8ffe710_1013    conda-forge
zstd                      1.5.2                h6255e5f_0    conda-forge

The output of spyder --debug-info verbose is pretty long, GitHub didn't allow me to paste it to the comment, so I attach a text file. After restarting I get a lot of [spyder_kernels.comms.commbase] -> Call to unconnected comm: flush_std.

spyder_log_restart_problem.txt

@dalthviz
Copy link
Member

Maybe not related with this but @ccordoba12 shouldn't the recipe for spyder-kernels on conda forge have the upper version constraint for ipython (ipython<8):

https://github.com/conda-forge/spyder-kernels-feedstock/blob/3112d0948434910039d956e4a3c5819c50f55552/recipe/meta.yaml#L32

As the constraint on spyder-kernels setup.py?:

https://github.com/spyder-ide/spyder-kernels/blob/f5d26cbdc4adf686ad8ec445f1ce0caad8a6e55f/setup.py#L45

Checking @mmagnuski conda list output, and my own env, ipython 8.0.1 is installed

Regarding the log I guess it's related with the comms handling (I saw a similar log entry in #17042 ) but no idea :/

Just in case, pinging @impact27 for ideas

@mmagnuski
Copy link
Author

@dalthviz I can check if downgrading ipython helps. Let me know if there is something else I can do.
Currently I can restart the console by closing it and opening another one. It's not ideal, but I can live with it. :)

@mmagnuski
Copy link
Author

I just wanted to highlight the fact that I get this error at startup ("System cannot find specified path") but after about 2 seconds it turns into normal text and the console can be interacted with:

@dalthviz
Copy link
Member

@mmagnuski regarding that error message, seems like could be related with invalid paths present in your PATH env variable. Could you check if all the paths in your PATH env variable are still valid? Also, just in case, please update to the new build for spyder-kernels (this one has the constraint for ipython<8) Let us know if something of that helps!

@mmagnuski
Copy link
Author

Thanks @dalthviz, I'm currently away from the machine that caused the problem, so I will let you know in about 2 days.

@ccordoba12
Copy link
Member

This is similar to issue #17042 in the sense that if some text is present in the kernel stderr's file, then the kernel can't be restarted. We fixed that issue for the Windows installer, but this one shows that this is a general problem.

@impact27, what do you think we should do about this? Perhaps trying to detect if a traceback is present in the stderr file and if not, ignore its contents when restarting?

@impact27
Copy link
Contributor

The problem is that _abort_kernel_restart assumes that anything written to the file was written during startup. So if I do:
import sys; sys.__stderr__.write("Hello") in a kernel, _abort_kernel_restart won't let me restart it.

@impact27
Copy link
Contributor

_abort_kernel_restart should only abort if the kernel crashed during startup, which can not be infferend by looking at the stderr file.

@ccordoba12
Copy link
Member

Exactly, that's my idea too. But how can we infer that?

@ccordoba12 ccordoba12 changed the title Can't restart kernel of the spyder console Can't restart kernel due to content in stderr file Jan 31, 2022
@ccordoba12 ccordoba12 added this to the v5.3.0 milestone Jan 31, 2022
@impact27
Copy link
Contributor

If "_when_prompt_is_ready" is called, the kernel did not crash during startup.

@mmagnuski
Copy link
Author

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants