Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\Users\AA>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:\ProgramData\Anaconda3\lib\asyncio\proactor_events.py", line 768, in _loop_self_reading
    f.result()  # may raise
  File "C:\ProgramData\Anaconda3\lib\asyncio\windows_events.py", line 808, in _poll
    value = callback(transferred, key, ov)
  File "C:\ProgramData\Anaconda3\lib\asyncio\windows_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...
like image 942
Amin Merati Avatar asked Jan 06 '21 10:01

Amin Merati


1 Answers

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)

like image 58
Jack Champagne Avatar answered Oct 13 '22 17:10

Jack Champagne