Python console does not allow for user input with the input() function
When I type
input()
in the Python console, this command just ends up in the command queue, and I can input the next command (showing >>> or In[2]: with IPython).
Thus, everything that I try to send input to the input() function, this input is just queued as a new command, which makes it impossible to pass input to the input() function:
>>> input()
>>> Test
>>> abc
>>>
I followed the instructions here https://youtrack.jetbrains.com/issue/PY-51667 to disable the command queue. However, the console is now just waiting for the command to finish, and I still cannot send input to the running command ("Previous command is still running. Please wait or press Ctrl+C in console to interrupt.")
I am using PyCharm 2022.1.2 (Professional Edition).
I am surprised that I could not find any solution to this online, as this seems to be a very common thing to do. I could only find posts where no input could be entered when running code due to an incorrect run configuration (note that I am using the Python console and not the "run code" feature). All similar posts that I could find have apparently been solved in previous versions.
Please sign in to leave a comment.
Hi, I couldn't reproduce the issue (both with the command queue enabled and disabled).
Please try the following:
Do you get the output?
Thanks for the quick reply. No, I don't get this output, all three "commands" (counting the random input as a command) end up in the queue.
I also checked on my laptop (running Linux) and noticed the same behavior.
However, I found out that this is specific to remote interpreters. When I open a project without a remote Python interpreter, everything works as intended.
It seems to be a known issue https://youtrack.jetbrains.com/issue/PY-29157/input-doesnt-work-in-console-with-remote-interpreter
I'm sorry for the inconvenience.