Spyder: "Parent poll failed" warning

Created on 6 Nov 2018  ·  34Comments  ·  Source: spyder-ide/spyder

Description

What steps will reproduce the problem?

  1. Start Spyder
  2. Do something in the IPython console (probably not necessary)
  3. Restart kernel

The resulting message is the "parent poll failed" message"

parentpoller.py:116: UserWarning: Parent poll failed.  If the frontend dies,
                the kernel may be left running.  Please let us know
                about your system (bitness, Python, etc.) at
                [email protected]
  [email protected]""")

This may be related to some of the discussion in #7842, but I seem to only see this when I restart a kernel now.

Versions

  • Spyder version: 4.0.0.dev0
  • Python version: 3.7.0
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies

pygments >=2.0    :  2.2.0 (OK)
sphinx >=0.6.6    :  2.0.0 (OK)
pyls >=0.19.0     :  0+unknown (OK)
nbconvert >=4.0   :  5.4.0 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
numpy >=1.7       :  1.15.2 (OK)
sympy >=0.7.3     :  1.3 (OK)
cython >=0.21     :  0.28.5 (OK)
qtconsole >=4.2.0 :  4.4.2 (OK)
IPython >=4.0     :  7.0.1 (OK)
matplotlib >=2.0.0:  3.0.1 (OK)
pylint >=0.25     :  2.1.1 (OK)
Awaiting Followup

All 34 comments

Here is the obligatory conda list:

# Name                    Version                   Build  Channel
alabaster                 0.7.11                   py37_0
appdirs                   1.4.3            py37h28b3542_0
asn1crypto                0.24.0                   py37_0
astroid                   2.0.4                    py37_0
astropy                   3.0.5            py37he774522_0
atomicwrites              1.2.1                    py37_0
attrs                     18.2.0           py37h28b3542_0
automat                   0.7.0                    py37_0
babel                     2.6.0                    py37_0
backcall                  0.1.0                    py37_0
bcrypt                    3.1.4            py37hfa6e2cd_0
blas                      1.0                         mkl
bleach                    2.1.4                    py37_0
ca-certificates           2018.03.07                    0
certifi                   2018.10.15               py37_0
cffi                      1.11.5           py37h74b6da3_1
chardet                   3.0.4                    py37_1
cloudpickle               0.6.1                    py37_0
colorama                  0.3.9                    py37_0
conda                     4.5.11                   py37_0
conda-env                 2.6.0                         1
console_shortcut          0.1.1                         3
constantly                15.1.0           py37h28b3542_0
coverage                  4.5.1            py37hfa6e2cd_0
cryptography              2.3.1            py37h74b6da3_0
cycler                    0.10.0                   py37_0
cython                    0.28.5           py37h6538335_0
decorator                 4.3.0                    py37_0
defusedxml                0.5.0                    py37_1
docutils                  0.14                     py37_0
entrypoints               0.2.3                    py37_2
fastcache                 1.0.2            py37hfa6e2cd_2
flaky                     3.4.0                    py37_0
freetype                  2.9.1                ha9979f8_1
future                    0.17.1                   py37_0
future                    0.17.1                    <pip>
h5py                      2.8.0            py37h3bdd7fb_2
hdf5                      1.10.2               hac2f561_1
html5lib                  1.0.1                    py37_0
hyperlink                 18.0.0                   py37_0
icc_rt                    2017.0.4             h97af966_0
icu                       58.2                 ha66f8fd_1
idna                      2.7                      py37_0
imagesize                 1.1.0                    py37_0
incremental               17.5.0                   py37_0
intel-openmp              2019.0                      118
ipykernel                 5.1.0            py37h39e3cac_0
ipython                   7.0.1            py37h39e3cac_0
ipython_genutils          0.2.0                    py37_0
ipywidgets                7.4.2                    py37_0
isort                     4.3.4                    py37_0
jedi                      0.12.1                   py37_0
jinja2                    2.10                     py37_0
jpeg                      9b                   hb83a4c4_2
jsonschema                2.6.0                    py37_0
jupyter                   1.0.0                    py37_7
jupyter_client            5.2.3                    py37_0
jupyter_console           5.2.0                    py37_1
jupyter_core              4.4.0                    py37_0
keyring                   16.0.0                   py37_0
kiwisolver                1.0.1            py37h6538335_0
lazy-object-proxy         1.3.1            py37hfa6e2cd_2
libpng                    1.6.35               h2a8f88b_0
libsodium                 1.0.16               h9d3ae62_0
libtiff                   4.0.9                h36446d0_2
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.0              py37hfa6e2cd_1
matplotlib                3.0.1            py37hc8f65d3_0
mccabe                    0.6.1                    py37_1
menuinst                  1.4.14           py37hfa6e2cd_0
mistune                   0.8.3            py37hfa6e2cd_1
mkl                       2019.0                      118
mkl_fft                   1.0.6            py37hdbbee80_0
mkl_random                1.0.1            py37h77b88f5_1
mock                      2.0.0                    py37_0
more-itertools            4.3.0                    py37_0
mpmath                    1.0.0                    py37_2
msys2-conda-epoch         20160418                      1
nbconvert                 5.4.0                    py37_1
nbformat                  4.4.0                    py37_0
networkx                  2.2                      py37_1
notebook                  5.7.0                    py37_0
numpy                     1.15.2           py37ha559c80_0
numpy-base                1.15.2           py37h8128ebf_0
numpydoc                  0.8.0                    py37_0
olefile                   0.46                     py37_0
openssl                   1.0.2p               hfa6e2cd_0
packaging                 18.0                     py37_0
pandas                    0.23.4           py37h830ac7b_0
pandoc                    1.19.2.1             hb2460c7_1
pandocfilters             1.4.2                    py37_1
paramiko                  2.4.2                    py37_0
parso                     0.3.1                    py37_0
pbr                       4.2.0                    py37_0
pickleshare               0.7.5                    py37_0
pillow                    5.3.0            py37hdc69c19_0
pip                       10.0.1                   py37_0
pip                       18.1                      <pip>
pluggy                    0.7.1            py37h28b3542_0
ply                       3.11                     py37_0
prometheus_client         0.3.1            py37h28b3542_0
prompt_toolkit            2.0.5                    py37_0
psutil                    5.4.8            py37he774522_0
py                        1.6.0                    py37_0
pyasn1                    0.4.4            py37h28b3542_0
pyasn1-modules            0.2.2                    py37_0
pycodestyle               2.4.0                    py37_0
pycosat                   0.6.3            py37hfa6e2cd_0
pycparser                 2.19                     py37_0
pyflakes                  2.0.0                    py37_0
pygments                  2.2.0                    py37_0
pyhamcrest                1.9.0                    py37_2
pylint                    2.1.1                    py37_0
pynacl                    1.3.0            py37h62dcd97_0
pyopenssl                 18.0.0                   py37_0
pyparsing                 2.2.1                    py37_0
pyqt                      5.9.2            py37h6538335_2
pysocks                   1.6.8                    py37_0
pytest                    3.8.2                    py37_0
pytest-arraydiff          0.2              py37h39e3cac_0
pytest-astropy            0.4.0                    py37_0
pytest-cov                2.6.0                    py37_0
pytest-doctestplus        0.1.3                    py37_0
pytest-mock               1.10.0                   py37_0
pytest-openfiles          0.3.0                    py37_0
pytest-remotedata         0.3.0                    py37_0
pytest-timeout            1.3.2                    py37_0
python                    3.7.0                hea74fb7_0
python-dateutil           2.7.3                    py37_0
python-jsonrpc-server     0.0.2                     <pip>
python-language-server    0+unknown                 <pip>
pytz                      2018.5                   py37_0
pywin32                   223              py37hfa6e2cd_1
pywinpty                  0.5.4                    py37_0
pyzmq                     17.1.2           py37hfa6e2cd_0
QDarkStyle                2.6.1                     <pip>
qt                        5.9.6            vc14h1e9a669_2
qtawesome                 0.5.2                    py37_0
qtconsole                 4.4.2                    py37_0
qtpy                      1.5.2                    py37_0
requests                  2.19.1                   py37_0
rope                      0.11.0                   py37_0
ruamel_yaml               0.15.46          py37hfa6e2cd_0
scipy                     1.1.0            py37h4f6bf74_1
send2trash                1.5.0                    py37_0
service_identity          17.0.0           py37h28b3542_0
setuptools                40.4.3                   py37_0
simplegeneric             0.8.1                    py37_2
sip                       4.19.8           py37h6538335_0
six                       1.11.0                   py37_1
snowballstemmer           1.2.1                    py37_0
Sphinx                    2.0.0.dev20181016           <pip>
sphinxcontrib             1.0                      py37_1
sphinxcontrib-websupport  1.1.0                    py37_1
spiceypy                  2.1.2                     <pip>
spyder-kernels            1.2.0.dev0                <pip>
sqlite                    3.25.2               hfa6e2cd_0
sympy                     1.3                      py37_0
terminado                 0.8.1                    py37_1
testpath                  0.4.2                    py37_0
tk                        8.6.8                hfa6e2cd_0
tornado                   5.1.1            py37hfa6e2cd_0
traitlets                 4.3.2                    py37_0
twisted                   18.7.0           py37hfa6e2cd_1
typed-ast                 1.1.0            py37hfa6e2cd_0
urllib3                   1.23                     py37_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.15.26706          h3a45250_0
wcwidth                   0.1.7                    py37_0
webencodings              0.5.1                    py37_1
wheel                     0.32.0                   py37_0
widgetsnbextension        3.4.2                    py37_0
win_inet_pton             1.0.1                    py37_1
wincertstore              0.2                      py37_0
winpty                    0.4.3                         4
wrapt                     1.10.11          py37hfa6e2cd_2
yaml                      0.1.7                hc54c509_2
zeromq                    4.2.5                he025d50_1
zlib                      1.2.11               h8395fce_2
zope                      1.0                      py37_1
zope.interface            4.5.0            py37hfa6e2cd_0

Also, I have the latest dev version of spyder-kernels and python-language-server is checked out to the 0.19.0 tag of its develop branch

This is not something we can address in Spyder because it's an ipykernel issue and (as far as I know) it only happens in Python 3.7.

@minrk, have you seen this before?

FWIW if I am running in debug level 3 and check the terminal, i see this in the debug terminal:

2018-11-08 20:11:56,828 [DEBUG] [traitlets] -> stream: {'name': 'stderr', 'text': 'C:\\miniconda\\miniconda3\\lib\\site-packages\\ipykernel\\parentpoller.py:116: UserWarning: Parent poll failed.  If the frontend dies,\n                the kernel may be left running.  Please let us know\n                about your system (bitness, Python, etc.) at\n                [email protected]\n  [email protected]""")\n'}

But I don't see that in the kernel at Spyder startup. I'm not sure why this warning is not being printed to the GUI console the first time, but is being printed on subsequent kernel restarts.

I thought that behavior was also curious and worth noting here.

I haven't seen this before, but parent polling on windows uses a Windows API call, so it could be that something changed here that we need to take care of.

@minrk, how can we help to solve this?

The check is implemented here, calling WaitForMultipleObjects. I think we'd need some testing of the WaitForMultipleObjects behavior to see what might have changed.

I don't currently have win10 to test on.

Is this a 32b or 64b process? It's possible we've done something slightly wrong with our 32/64b check.

From the docs, I'm guessing we are getting the WAIT_FAILED result, and we should be calling GetLastError to get the informative error from Windows. This might point us in the right direction.

@CAM-Gerlach or @jnsebgosselin (Spyder devs) have Windows 10 boxes, so they could you to test anything you need.

I am also on Windows 10 64-bit

@minrk Make sure to check out #7842 for some more details from when this was originally reported. This also occurs on my Win 8.1 x64 machine running Python 3.7.0 (64-bit, ofc) and the latest Spyder 3.x at the time, in both ipykernel 4.8,2 and (IIRC) 4.9.x, but not under Python 3.6.6 in an otherwise identical configuration. Let me know what you'd like me to specifically test further.

Thanks! I think it's definitely something that changed in Python 3.7, I just don't know what yet.

@minrk I can repro this in QtConsole on Py3.7/Win 8.1, so the problem definitely isn't with Spyder's codebase. Should I report it there and see if any of the Jupyter guys know how to fix it, or what the cause is? Is there something you'd like me to test?

One problem with spyder is that if I run from the recently added menu (the window bar on the left under windows 10), it will show
os.environ['PROJ_LIB']
Traceback (most recent call last):

File "", line 1, in
os.environ['PROJ_LIB']

File "C:UsersJaAnaconda3envsworklibos.py", line 669, in __getitem__
raise KeyError(key) from None

KeyError: 'PROJ_LIB'

but if I echo in the anaconda prompt, it shows normally:

echo %PROJ_LIB%
C:UsersJaAnaconda3Libraryshare

@jamessong, your problem has nothing to do with what is discussed here, so please don't try to derail this issue. Besides, I told you already how to fix it: start Spyder from the Anaconda prompt. If you don't want to maintain it open, use this command: spyder --hide-console.

It is exactly related to the original post 

On Monday, November 26, 2018 10:02 PM, Carlos Cordoba <[email protected]> wrote:

@jamessong, your problem has *nothing to do with what is discussed here, so please don't try to derail this issue. Besides, I told you already how to fix it: start Spyder from the Anaconda prompt. If you don't want to maintain it open, use this command: spyder --hide-console.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

One problem with spyder is that if I run from the recently added menu (the window bar on the left under windows 10), it will show
os.environ['PROJ_LIB']

Sorry, but I'm not sure how I understand how that has anything to do with the original post, about the Parent poll failed message appearing on Python 3.7 when a kernel is restarted.

I encountered the same issue. Then I downgraded mkl (2019.1->2018.0.3), upgraded matplotlib (2.2.3->3.0.1) and numpy (1.15.1->1.15.4), upgrade ipython, ipykernel via conda upgrade command and the issue disappeared. Hope this helps.

I had installed Anaconda 3, with Spyder 3.3.1 and Python 3.7.0 64 bit |Qt 5.9.6| PyQt5.5.9.2| Windows 10. and was experiencing this peoblem.
Yesterday, I upgraded to Spyder 3.3.2.
I have been running the same scrits for last 24 hours and the Kernel has not crashed yet. Maybe, this problem has been solved.
Thanks to the teams of Pierre Raybaut and Carlos Cordoba and the international Spyder Community.
Proud of all of you.

  • Suresh

Since I did restart the kernel today, I am experiencing the same issue on Windows 10 with Python 3.7. I did upgrade to the Spyder 3.3.2, but still warning UserWarning: Parent poll failed. If the frontend dies, the kernel may be left running How can I solve this?

@NdaAzr Its just a warning, so there's nothing to really "solve" unless you see specific symptoms. It seems likely to be an issue with ipykernel or jupyter_client rather than anything with Spyder, given the warning comes from the former package. @minrk any ideas?

@CAM-Gerlach Thank you for the reply. Even warning makes user worry. Today I was trying to do something like clear all and I did change run configuration per file to remove all variables before execution in spyder, and I got an error AttributeError: module '__main__' has no attribute '__spec__' while my code will run without any error in Anaconda Prompt window. any idea?

@NdaAzr, please update spyder-kernels to 0.3.0. That version fixes your error.

@ccordoba12 Thank you. yes, it fixed the error. Should I worry about user warning UserWarning: Parent poll failed. If the frontend dies, the kernel may be left running. Please let us know .

I think @CAM-Gerlach was clear enough, I don't know what else you want from me.

@ccordoba12 Yes that one is solved. Thank you.
I was just refering to the

Since I did restart the kernel today, I am experiencing the same issue on Windows 10 with Python 3.7. I did upgrade to the Spyder 3.3.2, but still warning UserWarning: Parent poll failed. If the frontend dies, the kernel may be left running How can I solve this?

And @ccordoba12 was referring to my direct response to that comment:

@NdaAzr Its just a warning, so there's nothing to really "solve" unless you see specific symptoms. It seems likely to be an issue with ipykernel or jupyter_client rather than anything with Spyder, given the warning comes from the former package.

So no, you should not worry.

@NdaAzr, please update spyder-kernels to 0.3.0. That version fixes your error.

Hi Carlos,
I updated this module to 0.3.0, but the problem still occurred
fig1

@geochemistry, I was talking about the multiprocessing error.

Closing because this has not been reported anymore.

Hello, I have the same problem with jupiter notebook (anaconda) when I import lightgbm:

...ipykernelparentpoller.py:116: UserWarning: Parent poll failed. If the frontend dies,
the kernel may be left running. Please let us know
about your system (bitness, Python, etc.) at
[email protected]
[email protected]""")

Before I had updated Numpy had never had this error. But I need the last version of Numpy to use shap package.

Does anyone know how to fix it for jupyter notebook?

I have the same problem with jupiter notebook (anaconda)

Does anyone know how to fix it for jupyter notebook?

This is the Spyder bug tracker, not Jupyter notebook. Please report your issue to them instead; thanks.

image
I installed tensorflow but failed, then pop up “UserWarning: Parent poll failed. If the frontend dies,
the kernel may be left running. Please let us know
about your system (bitness, Python, etc.) at
[email protected]
[email protected]""")”

other, I could not open spyder ,reset it will pop up “python 停止工作”

how I could do ?

@Gfqwy Please read this issue you posted to. What is shown is just a warning, which is not necessarily indicative of any specific problem. Furthermore, you should upgrade to latest Spyder-Kernels version, as stated earlier. You are using ancient (years old), unsupported IPython, Spyder-Kernels, Spyder, etc. packages, so please update your entire Anaconda environment to a modern version

From your description, its very unclear what the Spyder-specific problem(s) are, if any, that your are experiencing. Please reference Spyder Troubleshooting Guide, specifically the Basic First Aid section for some basic steps to try to fix it or at least narrow it down for us. Thanks, and best of luck!

Thanks, I have solved this issue.

------------------ 原始邮件 ------------------
发件人: "CAM Gerlach"<[email protected]>;
发送时间: 2020年4月16日(星期四) 下午4:49
收件人: "spyder-ide/spyder"<[email protected]>;
抄送: "雨越瑜时,钟子芷"<[email protected]>;"Mention"<[email protected]>;
主题: Re: [spyder-ide/spyder] "Parent poll failed" warning (#8205)

@Gfqwy Please read this issue you posted to. What is shown is just a warning, which is not necessarily indicative of any specific problem. Furthermore, you should upgrade to latest Spyder-Kernels version, as stated earlier. You are using ancient (years old), unsupported IPython, Spyder-Kernels, Spyder, etc. packages, so please update your entire Anaconda environment to a modern version

From your description, its very unclear what the Spyder-specific problem(s) are, if any, that your are experiencing. Please reference Spyder Troubleshooting Guide, specifically the Basic First Aid section for some basic steps to try to fix it or at least narrow it down for us. Thanks, and best of luck!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Was this page helpful?
0 / 5 - 0 ratings