Search code examples
pythonpycharmshap

How to solve the ERROR: usage: _jb_pytest_runner.py error running the SHAP test-cases with PyCharm?


I cannot get around this error while trying to run the shap test-cases with PyCharm:

/home/user/shap/venv/bin/python /home/user/Desktop/pycharm-community-2021.1.2/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py --path /home/user/shap/tests
Testing started at 10:51 a.m. ...
Launching pytest with arguments /home/user/shap/tests in /home/user/shap/tests

ERROR: usage: _jb_pytest_runner.py [options] [file_or_dir] [file_or_dir] [...]
_jb_pytest_runner.py: error: unrecognized arguments: --mpl --cov=shap --cov-report=term-missing
  inifile: /home/user/shap/pytest.ini
  rootdir: /home/user/shap


Process finished with exit code 4

Empty suite

I have tried different installations (pytest, pip and conda). I have also tried different Python versions as well as shap versions. Nothing worked.

Any help would be appreciated


Solution

  • The answer is simple. Install everything using the PyCharm (Settings->Project->Project Interpreter, and press +) and not the pip (or other) from the command line.