Spyder (python 3.9) experiencing an error every time I run a simple code

2,474 views
Skip to first unread message

Igi Bending-Rodriguez

unread,
May 22, 2022, 1:57:35 PM5/22/22
to spyder

I'm new to python and for the second day following an MIT course, when I use the following codes from the example py files provided, it encounters error and it had to be restarted to be used again.

The codes are as follows:

First one which crashes it is:

text = input("Type anything... ") 
print(5*text) 
num = int(input("Type a number... ")) 
print(5*num)

This one crashes it too:

x = float(input("Enter a number for x: ")) 
y = float(input("Enter a number for y: ")) 
if x == y: print("x and y are equal") 
if y != 0: print("therefore, x / y is", x/y) 
elif x < y: print("x is smaller") 
elif x > y: print("y is smaller") print("thanks!")

Mistake details are as follows:

Traceback (most recent call last): File "/home/fakamaz/anaconda3/lib/python3.9/site-packages/qtconsole/base_frontend_mixin.py", line 138, in _dispatch handler(msg) File "/home/fakamaz/anaconda3/lib/python3.9/site-packages/spyder/plugins/ipythonconsole/widgets/debugging.py", line 278, in _handle_input_request return super(DebuggingWidget, self)._handle_input_request(msg) File "/home/fakamaz/anaconda3/lib/python3.9/site-packages/qtconsole/frontend_widget.py", line 512, in _handle_input_request self._readline(msg['content']['prompt'], callback=callback, password=msg['content']['password']) File "/home/fakamaz/anaconda3/lib/python3.9/site-packages/qtconsole/console_widget.py", line 2422, in _readline self._show_prompt(prompt, newline=False, separator=False) TypeError: _show_prompt() got an unexpected keyword argument 'separator'

Interesting enough, when I try to run the code on my friends Windows PC - it works for a certain extend, but not completely. For instance it let you enter number or word, but do not "print' it later on...

On my Linux PC - it produces an error as above all the time...

So what gives? Did I break Spyder? :)

Igi Bending-Rodriguez

unread,
Jun 14, 2022, 3:20:38 AM6/14/22
to spyder
Considering how helpful this experience been so far here, I decided to break the circle and actually post some useful info, if someone experience the same problem. Apparently there's a version issue and this particular stuff affects quite a bunch of people, so without further adu here's the solution: https://github.com/spyder-ide/spyder/issues/17616#issuecomment-1088750490

And yeah, you'd have to run: conda activate spyder-cf

Pretty much every time when you run Python. Other than that - it works! Once again GitHub people proven they are the best! :) So if you're still stuck here, go there instead.



Daniel Althviz Moré

unread,
Jul 14, 2022, 1:22:51 PM7/14/22
to spyder
Thank you Igi for sharing the link to the issue!
Reply all
Reply to author
Forward
0 new messages