How to fix ModuleNotFoundError: No module named 'pytest'

ModuleNotFoundError: No module named 'pytest'
Recommended: Install via pip into your active environment.
python -m pip install pytest

Verification

Command
python -c "import pytest; print(pytest.__version__)"
Expected output
Success! pytest version x.y.z (e.g., 2.4.0)