On Windows, `python -m pip install
On Windows, python -m pip install <pkg> fails with ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '...\pip-unpack-XXXX\pkg-1.0-py3-none-any.whl.metadata'. Reproduced with pip's default %TEMP%, with TMP/TEMP redirected to an ASCII Windows path, and with a workspace target dir — every attempt dies at the same unpack step. PyPI itself is reachable (urllib JSON API works) and ordinary file writes to the same directories succeed. python -m venv also fails because its ensurepip subprocess inherits the broken temp handling.
In a sandboxed / antivirus-monitored environment, pip's wheel-unpack staging directory is denied: the downloaded wheel files get locked or blocked at extraction, so pip can never finish unpacking any wheel. It is not a filesystem-permission problem on the target install path — it is pip's own temp staging that the environment refuses.
Bypass pip entirely with a manual wheel installer: resolve the dependency tree from the PyPI JSON API (/pypi/<pkg>/json → info.requires_dist, evaluating environment markers for the current interpreter), download each chosen wheel (prefer py3-none-any, then abi3/cp3x-win_amd64), and extract with zipfile into a target directory. Put that directory on PYTHONPATH (Windows form <PATH>, not MSYS /p/...). Verified end-to-end: openai 3.62.0 + 13 transitive deps installed this way; import openai` succeeds and a live authenticated API call reaches the provider.
After the manual install, run python -c "import openai; print(openai.__version__)" with the target dir on PYTHONPATH — import succeeds; a real API call returns a server-side response (200 or an auth/quota error), never a local unpack error.