[Solved]-Installed pytest but running `pytest` in bash returns `not found`

21👍

Try python -m pytest

Installing pytest via pip doesn’t make it a system command, it installs it to python. The -m command runs pytest as its own command and then any proceeding script will be an argument.

0👍

I got problem when I wanted to run the following code in .sh file.

pytest-3 -s test.py

To solve it I get solution from linux itself as follows:

sudo apt install python3-pytest

Leave a comment