How do I disable -u interpreter option in PyCharm?

download python interpreter for pycharm
pycharm interpreter paths
pycharm virtualenv
pycharm download
pycharm install packages
pycharm interpreter pc
how to install the python interpreter in pycharm
pycharm python 3.8 interpreter

I am configuring PyCharm to use remote python interpreter. PyCharm seems to execute the interpreter with -u option, and I can't find a way to disable that. The reason I need it disabled is that I am running nosetests command, so I get this:

ssh://xxx@xxx.xxx.xxx.xxx:22/path/to/bin/nosetests -s -a M_4439 -u /path/to/test_elf.py

Usage: nosetests [options]

nosetests: error: no such option: -u

Process finished with exit code 2

I looked around, and could not find where -u is set. I checked:

  • Run -> Edit configurations. I have my options there: -s -a M_4439
  • Settings -> Project interpreter

Where is -u set?

Thank you.

I found that if you pass -u first in the "Interpreter Options" then it passes that parameter to the interpreter (python) as opposed to the library so I find that /opt/conda/bin/python -u -m torch.distributed.launch --nproc_per_node=4 your_script.py works, while /opt/conda/bin/python -m torch.distributed.launch --nproc_per_node=4 -u your_script.py does not.

Note that if you pass -u explicitly, it doesn't add it again later in the command.

Why does this word appear 'interpreter field is empty' in PyCharm? I , are available on Python Package Index (PyPI) and can be easily installed and accessed using pip install. I'm running my project via a remote pyspark interpreter. Everytime I run a script, PyCharm automatically adds the -u option to the run command. For example, the full run command is `ssh://vito@7.7.

Answering my own question, as per comment above:

PyCharm has its helper script to run nose tests. I configured the interpreter to be remote python and now I get this (which is what I need): ssh://xxx@xxx.xxx.xxx.xxx:22/path/to/bin/python -u /path/to/.pycharm_helpers/pycharm/noserunner.py /path/to/test_elf.py .

Now I just need to figure out pre-test scripts that are usually sourced from .bashrc. Edit configurations -> Before launch: Remote external tool does that

How do I fix the interpreter field is empty in PyCharm? Configure a Python interpreter. To work with your Python code in PyCharm, you need to configure at least one interpreter. You are not limited to using just any single Python interpreter. You are able to implement several and in doing so choose which interpreter you wish to use for any specific project.

According to IntelliJ the -u flag is "hardcoded" and there's no way to remove it.

UPDATE

IntelliJ currently has an open ticket for this.

Removing interpreter paths´╗┐ Select the paths to be deleted. In the toolbar of the Interpreter Paths dialog, click . The removed paths remain in the list with the note "removed by user". I've run into an annoying bug in PyCharm. I tried to add the same interpreter twice, with the intention to have them use different PYTHONPATH's. But when I added the second instance, this got the same name with a "(1)" after, and when added extra paths to this one it could not be saved - or rather I got no errors when saving, but the paths was

When you configure a project Python interpreter, you need to specify the path to the This checkbox corresponds to the --system-site-packages option of the privileges to install, remove, and upgrade packages for the system interpreter. Install, uninstall, and upgrade interpreter paths. PyCharm makes it possible to add paths to the selected interpreter. These paths will be added to the environment variable PYTHONPATH. Also, PyCharm will index these paths and (potentially) resolve the objects of the code (for example, imports of packages). Viewing interpreter paths

If IntelliJ IDEA detects no Python on your machine, it provides two options: to privileges to install, remove, and upgrade packages for the system interpreter. In the left-hand pane of the Add Python Interpreter dialog, select System Interpreter. In the Interpreter field, type the fully-qualified path to the required interpreter executable, or click and in the Select Python Interpreter dialog that opens, choose the desired Python executable and click OK.

PyCharm 2018.3 added an interpreter selector in the status bar. Although I can see the usefulness of it, it's not for me. The problem is Remove all; Disconnect; The next __count__/__total__ Find out why Close. how to fix Interpreter field is empty in pycharm easy and fast 2018 Invalid python interpreter selected for the

Comments
  • In edit configuration, did you look under Default-->Python tests-->Nosetests?
  • Just looked, there was nothing there. Your comment prompted me to look more. Apparently, PyCharm has its helper script to run nose tests. I configured the interpreter to be remote python and now I get this (which is what I need): ssh://xxx@xxx.xxx.xxx.xxx:22/path/to/bin/python -u /path/to/.pycharm_helpers/pycharm/noserunner.py /path/to/test_elf.py . Now I just need to figure out pre-test scripts that are usually sourced from .bashrc, and I am good to go.Thanks.
  • Can't figure out how to source a bash script before noserunner.py is executed (source from the same shell in which the tests will be executed)
  • Ok, Edit configurations -> Before launch: Remote external tool does that. Closed.
  • @Dormidont, I tried what you suggested and it worked. Can you move your answer from the comment to the answer section and mark it as the best answer? That way it'll be clear what the solution is.