python - IPython NoConsoleScreenBufferError (Windows)

Indlæg af Hanne Mølgaard Plasc

Problem



Når jeg kører nogen linje på IPython CLI på Windows, får jeg de fleste gange en NoConsoleScreenBufferError og konsollen afsluttes.


Dette sker, når du kører IPython fra Windows-terminalen (cmd.exe> ipython) eller når du bruger den indbyggede PyCharm-terminal (den bruger Windows-terminalen), som vælger IPython automatisk over den normale Python-terminal, i installeret.


Her er en del af det relevante spor:


  File "C:Python27libsite-packagesIPython\_\_init\_\_.py", line 119, in start\_ipython
    return launch\_new\_instance(argv=argv, **kwargs)
  File "C:Python27libsite-packages	raitletsconfigapplication.py", line 658, in launch\_instance
    app.start()
  File "C:Python27libsite-packagesIPython	erminalipapp.py", line 348, in start
    self.shell.mainloop()
  File "C:Python27libsite-packagesIPython	erminalinteractiveshell.py", line 486, in mainloop
    self.interact()
  File "C:Python27libsite-packagesIPython	erminalinteractiveshell.py", line 469, in interact
    code = self.prompt\_for\_code()
  File "C:Python27libsite-packagesIPython	erminalinteractiveshell.py", line 363, in prompt\_for\_code
    pre\_run=self.pre\_prompt, reset\_current\_buffer=True)
  File "C:Python27libsite-packagesprompt\_toolkitinterface.py", line 392, in run
    self.\_redraw()
  File "C:Python27libsite-packagesprompt\_toolkitinterface.py", line 351, in \_redraw
    self.renderer.render(self, self.layout, is\_done=self.is\_done)
  File "C:Python27libsite-packagesprompt\_toolkit
enderer.py", line 398, in render
    size = output.get\_size()
  File "C:Python27libsite-packagesprompt\_toolkit	erminalwin32\_output.py", line 103, in get\_size
    info = self.get\_win32\_screen\_buffer\_info()
  File "C:Python27libsite-packagesprompt\_toolkit	erminalwin32\_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

Bedste reference