I installed Jupyter and Ipython in a virtual environment. Whenever I type something in the IPython REPL and press enter, the output is prepended with a bunch of repeated garbage:
In [2]: print("Hello, world!")
line='print("Hello, world!")\n', last_line=b'', encoding=None
print
(
"Hello, world!"
)
line=b'', last_line='print("Hello, world!")\n', encoding=None
line='print("Hello, world!")\n', last_line=b'', encoding=None
print
(
"Hello, world!"
)
line=b'', last_line='print("Hello, world!")\n', encoding=None
line='print("Hello, world!")\n', last_line=b'', encoding=None
print
(
"Hello, world!"
)
line=b'', last_line='print("Hello, world!")\n', encoding=None
Hello, world!
In [3]: 2 + 2
line='2 + 2\n', last_line=b'', encoding=None
2
+
2
line=b'', last_line='2 + 2\n', encoding=None
line='2 + 2\n', last_line=b'', encoding=None
2
+
2
line=b'', last_line='2 + 2\n', encoding=None
line='2 + 2\n', last_line=b'', encoding=None
2
+
2
line=b'', last_line='2 + 2\n', encoding=None
line='2 + 2', last_line=b'', encoding=None
2
+
2
line='', last_line='2 + 2', encoding=None
Out[3]: 4
This garbage output occurs in both IPython REPL in a terminal, and Jupyter notebooks in a browser.
I'm running Windows 10 with Python 3.8.1. The package versions are:
- jupyter 1.0.0
- ipython 7.17.0
- notebook 6.1.1
These were installed via Poetry. I installed the exact same Python and package versions on a separate PC (running Linux) and the problem did not appear, so I suspect something is configured wrong on my Windows PC rather than the problem being a bug in IPython.
How do I make it print like normal again?