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

Kernel dies when trying to plot an image with matplotlib #6219

Closed
astro-jingtao opened this issue Nov 1, 2021 · 4 comments
Closed

Kernel dies when trying to plot an image with matplotlib #6219

astro-jingtao opened this issue Nov 1, 2021 · 4 comments

Comments

@astro-jingtao
Copy link

Describe the bug
Kernel dies when running plt.plot([0,1], [0,1])

To Reproduce
run this code

import matplotlib.pyplot as plt
plt.plot([0,1], [0,1])

Expected behavior
I expected matplotlib to plot the image

Desktop (please complete the following information):

  • OS: windows 10
  • Browser chrome
    image

Additional context
From the console log of jupyter notebook:

ERROR:asyncio:Exception in callback <TaskWakeupMethWrapper object at 0x000001C6AC984F10>(<Future finis...d8a"\r\n\r\n'>)
handle: <Handle <TaskWakeupMethWrapper object at 0x000001C6AC984F10>(<Future finis...d8a"\r\n\r\n'>)>
Traceback (most recent call last):
  File "C:\Users\[myusername]\anaconda3\lib\asyncio\events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-10' coro=<HTTP1ServerConnection._server_request_loop() running at C:\Users\[myusername]\anaconda3\lib\site-packages\tornado\http1connection.py:823> wait_for=<Future finished result=b'GET /custom...fd8a"\r\n\r\n'> cb=[IOLoop.add_future.<locals>.<lambda>() at C:\Users\[myusername]\anaconda3\lib\site-packages\tornado\ioloop.py:688]> while another task <Task pending name='Task-147' coro=<KernelManager._async_start_kernel() running at C:\Users\[myusername]\anaconda3\lib\site-packages\jupyter_client\manager.py:336>> is being executed.

I have checked issue 6089 and 3709, not my case.

@kevin-bates
Copy link
Member

Hi @MySlientWind - this may be more related to #6164 than matplotlib. Can you see if the workaround described there helps (i.e., using the AsyncMappingKernelManager)? (Thanks)

@astro-jingtao
Copy link
Author

Hi @MySlientWind - this may be more related to #6164 than matplotlib. Can you see if the workaround described there helps (i.e., using the AsyncMappingKernelManager)? (Thanks)

Thanks for your reply, using the AsyncMappingKernelManager do fix the asyncio error but unfortunately plt.plot([0,1], [0,1]) still fail and kernel still die.

@astro-jingtao
Copy link
Author

This error also exists when I use jupyter lab or vscode.

@astro-jingtao
Copy link
Author

astro-jingtao commented Nov 2, 2021

I found this is not a jupyter notebook issue but matplotlib issue, see following links for details

The solution is conda install freetype=2.10.4

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants