For macos, try these
python3 -m venv path/to/venv source path/to/venv/bin/activate python3 -m pip install pynvim