简体   繁体   English

运行命令时 IPython 崩溃

[英]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.1Python 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.

相关问题 matplotlib:从命令行运行 ipython 时,在 Web 浏览器中按顺序显示绘图 - matplotlib: display plots sequentially in web browser when running ipython from command line python作为脚本运行时导入失败,但在iPython中却没有? - import fails when running python as script, but not in iPython? 运行ipython笔记本时pyzmq丢失了 - pyzmq missing when running ipython notebook .EXE 安装程序在安装 Python 模块时崩溃:IPython、Pandas 和 Matplotlib - .EXE installer crashes when installing Python modules: IPython, Pandas and Matplotlib 在 IPython 中运行 %%cython-magic 单元时,CompileError/LinkerError: &quot;command &#39;gcc&#39; failed with exit status 1&quot; 是什么意思 - What does CompileError/LinkerError: "command 'gcc' failed with exit status 1" mean, when running %%cython-magic cell in IPython 通过双击通过iPython或命令窗口运行代码 - Running code through iPython or command window by double clicking IPython - 使用 %run 命令运行脚本 - 保存到哪个文件夹? - IPython - running a script with %run command - saved to which folder? 从ipython解释器而不是命令行运行模块 - Running module from ipython interpreter instead of command line 查看以前的命令是否仍在PyCharm IPython控制台中运行? - See if previous command is still running in PyCharm IPython console? 运行烧瓶时是否有任何选项获取 ipython 命令提示符 - Is there any option getting ipython command prompt while running flask
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM