Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

windows - Error in ipython console "Exception [WinError 995] The I/O operation has been aborted"

I have installed python 3.8.5 and in ipython 7.19.0 via Anaconda installer on Windows 10 machine and I get the following error in Ipython when I import keras and then run ls or any other commands. It happens when I import other commands or run other commands. Can anybody propose any solution? Is this to do with latest python or Ipython? Or something else.

C:UsersAA>ipython
Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from keras.models import load_model
2021-01-06 10:36:43.729592: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll

In [2]: ls

Unhandled exception in event loop:
  File "C:ProgramDataAnaconda3libasyncioproactor_events.py", line 768, in _loop_self_reading
    f.result()  # may raise
  File "C:ProgramDataAnaconda3libasynciowindows_events.py", line 808, in _poll
    value = callback(transferred, key, ov)
  File "C:ProgramDataAnaconda3libasynciowindows_events.py", line 457, in finish_recv
    raise ConnectionResetError(*exc.args)

Exception [WinError 995] The I/O operation has been aborted because of either a thread exit or an application request
Press ENTER to continue...

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It seems to be a bug in the ipython prompt toolkit (version >= 3)

Try doing this for your environment:

conda install prompt-toolkit~=2.0

Generally we can fix this by doing something like this:

py -m pip install -U prompt-toolkit~=2.0

If that does not seem to work, there is an extensive discussion of the bug here with a few other solutions: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1023#issue-534396318

(Discussed in this issue: https://github.com/jquast/blessed/issues/121)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...