22

I started using ipython recently. Now I often get this message upon doing any action, even simple ones like defining variables:

>>> num = 1

Unhandled exception in event loop:
File "c:\users\USER\appdata\local\programs\python\python38-32\lib\asyncio\proactor_events.py", line 768, in _loop_self_reading
    f.result()  # may raise
File "c:\users\USER\appdata\local\programs\python\python38-32\lib\asyncio\windows_events.py", line 808, in _poll
    value = callback(transferred, key, ov)   
File "c:\users\USER\appdata\local\programs\python\python38-32\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...

This message sometimes shows up, sometimes not, for the same command. Have no idea what I did wrong. The normal interpreter doesn't have this problem. Using 3.8 and installed ipython 7.10.2 through the cmd. Thanks.

6
  • 1
    provide code example please Commented Dec 16, 2019 at 11:42
  • 2
    I'm just trying to type in something like xyz = "hello" and getting the above message Commented Dec 16, 2019 at 11:45
  • @ziggy welcome to SO. You may want to read How to Ask and minimal reproducible example and edit your question accordingly. Commented Dec 16, 2019 at 12:37
  • 1
    beatrice, I actually think this is all. No code... @ziggy, is this all? Do you just start your live interpreter, type in a variable, like num=1, and the error occurs? No code is running? If so, I would assume something has gone wrong with the installation. Commented Dec 16, 2019 at 13:44
  • @magnus exactly. It's not a code problem. I just want to use ipython on a new computer and have no idea what went wrong. I tried reinstalling several times but it didn't help. Commented Dec 16, 2019 at 14:43

1 Answer 1

31
+50

I managed to solve the problem. There is some incompatibility between the ipython v7.10.2 and prompt toolkit v3.x. However, everything works fine when downgrading to prompt toolkit v2.x:

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

I was advised to do so by the ipython staff at github (so credit to them).

Sign up to request clarification or add additional context in comments.

2 Comments

Had the same problem recently after upgrading ipython (and all its dependencies). Previously, it just randomly prompted me to Press Enter to Continue for stuff that shouldn't have needed it (In [1]: 1 + 2 would do it roughly a third of the time); after the upgrade, it started dumping the same traceback you described too. Downgrading prompt_toolkit seems to have solved both problems. Guessing the problem was the same in both cases, but different versions of ipython and its various dependencies changed whether it died loudly (w/traceback) or quietly (Press Enter prompt only). Thanks!
This fix worked for me . github.com/ipython/ipython/issues/12049#issuecomment-586544339 -- on win10, ipython 7.13.0, prompt-toolkit 3.0.5, python 3.8.2 win32, using bash from git-bash inside windows terminal (latest)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.