[英]IPython Crashes when Running Command
I'm using IPython 7.18.1
and Python 3.8.3
on Windows 10
.我在
Windows 10
上使用IPython 7.18.1
7.18.1 和Python 3.8.3
。
When I execute a command in IPython, it returns the result of the command but with an error.当我在 IPython 中执行命令时,它会返回命令的结果但有错误。 Later IPython exits.
后来 IPython 退出。 This seems to happen randomly on different terminals.
这似乎在不同的终端上随机发生。
C:\Users\14116>ipython
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 1
Out[1]: 1
In [2]: 2
Out[2]: 2
Traceback (most recent call last):
File "c:\program files\python38\lib\asyncio\windows_events.py", line 430, in select
self._poll(timeout)
RuntimeError: <_overlapped.Overlapped object at 0x0000019E0480D6F0> still has pending operation at deallocation, the process may crash
In [3]:
C:\Users\14116>
I've searched for a long time on google, but there's no result.我在谷歌上搜索了很长时间,但没有结果。 Any ideas?
有任何想法吗?
I'm using IPython 7.18.1
and Python 3.8.3
on Windows 10
.我在
Windows 10
上使用IPython 7.18.1
和Python 3.8.3
。
When I execute a command in IPython, it returns the result of the command but with an error.当我在 IPython 中执行命令时,它返回命令的结果但有错误。 Later IPython exits.
后来 IPython 退出了。 This seems to happen randomly on different terminals.
这似乎在不同的终端上随机发生。
C:\Users\14116>ipython
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 1
Out[1]: 1
In [2]: 2
Out[2]: 2
Traceback (most recent call last):
File "c:\program files\python38\lib\asyncio\windows_events.py", line 430, in select
self._poll(timeout)
RuntimeError: <_overlapped.Overlapped object at 0x0000019E0480D6F0> still has pending operation at deallocation, the process may crash
In [3]:
C:\Users\14116>
I've searched for a long time on google, but there's no result.我在谷歌上搜索了很长时间,但没有结果。 Any ideas?
有任何想法吗?
I encountered the same problem, and asyncio version 3.4.3 was already the version that I had installed.我遇到了同样的问题,asyncio 3.4.3 版本已经是我安装的版本了。
For me, I had a hacky solution which was to open the __init__.py
file in the site-packages/IPython
directory, and add the following lines somewhere during the execution of the file:对我来说,我有一个 hacky 解决方案,即打开
site-packages/IPython
目录中的__init__.py
文件,并在文件执行期间的某处添加以下行:
import asyncio
import platform
if platform.system() == 'Windows':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
The code snippet came from the solution of "RuntimeError: <_overlapped.Overlapped object> still has pending operation at deallocation" while using aiohttp代码片段来自使用 aiohttp 时“RuntimeError: <_overlapped.Overlapped object> 在释放时仍有待处理操作”的解决方案
I'll see where I can report this bug so that it can be fixed more properly.我会看看我可以在哪里报告这个错误,以便更正确地修复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.