在Windows上运行ipythoncli上的任何一行时,大多数情况下我都会得到一个NoConsoleScreenBufferError并且控制台被终止。在
当从Windows终端(cmd.exe>;ipython)运行IPython时,或者使用嵌入式PyCharm终端(它使用Windows终端)时,会自动选择IPython而不是常规Python终端。在
以下是相关跟踪的一部分:File "C:\Python27\lib\site-packages\IPython\__init__.py", line 119, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "C:\Python27\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
app.start()
File "C:\Python27\lib\site-packages\IPython\terminal\ipapp.py", line 348, in start
self.shell.mainloop()
File "C:\Python27\lib\site-packages\IPython\terminal\interactiveshell.py", line 486, in mainloop
self.interact()
File "C:\Python27\lib\site-packages\IPython\terminal\interactiveshell.py", line 469, in interact
code = self.prompt_for_code()
File "C:\Python27\lib\site-packages\IPython\terminal\interactiveshell.py", line 363, in prompt_for_code
pre_run=self.pre_prompt, reset_current_buffer=True)
File "C:\Python27\lib\site-packages\prompt_toolkit\interface.py", line 392, in run
self._redraw()
File "C:\Python27\lib\site-packages\prompt_toolkit\interface.py", line 351, in _redraw
self.renderer.render(self, self.layout, is_done=self.is_done)
File "C:\Python27\lib\site-packages\prompt_toolkit\renderer.py", line 398, in render
size = output.get_size()
File "C:\Python27\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 103, in get_size
info = self.get_win32_screen_buffer_info()
File "C:\Python27\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 150, in get_win32_screen_buffer_info
raise NoConsoleScreenBufferError
NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True