Home Running pytest on mac - command not found: pytest
Post
Cancel

Running pytest on mac - command not found: pytest

Installing pytest with pip will return the following error.

1
2
learnGPT-team2 % pytest test_ex.py -s -vv
zsh: command not found: pytest

In this case, 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.

1
python3 -m pytest test_ex.py -s -vv

stack overflow

This post is licensed under CC BY 4.0 by the author.

Making about.md as default jekyll page and add a separate posts tab

Jekyll post title escape character