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

Question:

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

Asked By: 3xCh1_23

||

Answers:

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.

Answered By: 3xCh1_23

Remove/Comment from pytest.ini the line of code how contains –mpl –cov=shap –cov-report=term-missing
Run again and now work (i hope)

Answered By: Davide di silvestro
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.