Trouble getting pyo3 to use the virtualenv (Windows 10)

There seems to be nothing I can do to get pyo3 to recognize the virtualenv. It always uses the global installation. Forcing it by setting PYTHONHOME gives this error:

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

My minimal example, and what I’ve tried so far:

I’ve been told this “just works” on Linux, so I’m wondering if this is a Windows-specific issue or I have configured python incorrectly.

Anyone run into this before?