Dormidont
Dormidont

Reputation: 233

How do I disable -u interpreter option in PyCharm?

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://[email protected]: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:

Where is -u set?

Upvotes: 4

Views: 1660

Answers (3)

A.I.
A.I.

Reputation: 85

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.

Upvotes: 3

Vito
Vito

Reputation: 1688

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.

Upvotes: 1

Dormidont
Dormidont

Reputation: 233

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://[email protected]: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

Upvotes: 1

Related Questions