How to remove `-u` when running python script?

When I use `run` button in Pycharm, it will always add `-u` argument after the python interpreter, I wonder is there a way to remove this argument? Thanks!

0
6 comments

Hi,

Not sure about your statement

What's your PyCharm version?

0
Avatar
Permanently deleted user

I am using:

PyCharm 2019.3 (Professional Edition)
Build #PY-193.5233.109, built on November 28, 2019

And I am using the remote SSH Python Intepreter, not sure whether this will impact the argument or not.

 

Thanks for your help!

0

Yes, SSH interpreter does that... and there doesn't seem to be a way to disable that.

What is the issue you're having with the -u option? Is it something serious?

0
Avatar
Permanently deleted user

Yeah. I am developing a project on PySpark and is using spark-submit to run python files. The SSH interpreter can be succesfully set to spark-submit, it can identify the python env related to the spark-submit and shows all the package info. But when I use PyCharm to run the command, because spark-submit does not have `-u` option, the run will fail.

Actually PyCharm fully support this way of development except for the '-u' option. Is it possible to make this '-u' as an configurable option in the future version of PyCharm so that people can choose whether to turn it on or off?

Thanks. 

1

Understood. I think that instead of disabling the -u option, PyCharm should recognize if non-standard python interpreter is used, and run it accordingly. Unfortunately for now it assumes that you're running regular python and passes the -u option. I think this can be considered a bug.

Please submit it as a bug report to our issues tracker: https://youtrack.jetbrains.com/issues, with the use case and an example for better understanding of the issue.

0
Avatar
Permanently deleted user

Same problem here. Need a fast fix ASAP please.

0

Please sign in to leave a comment.