Open jaraco opened 2 years ago
I think the py
launcher in Python 3.11 changed some behaviors, it used to work fine when invoking with Command::new("py")
in Rust, but the 3.11 py
doesn't work, I had to use cmd /c py
to make it work in maturin
.
For completeness, I encountered the error when trying to build pyoxidizer with PYO3_PYTHON=py
:
For what it's worth, on the same machine where Rust has trouble with the process, Python can launch it fine:
>>> subprocess.Popen(['py', '-V']).wait()
Python 3.11.0
0
Did you know on Windows, the default installation options don't include installing Python on the PATH, but the default installation options do include installing the
py
launcher on the PATH? Perhaps pyo3 could be smarter and fall back topy -3
or simplypy
when no executable is specified.I tried setting
PYO3_PYTHON=py
to see if a generic executable as found on the path could be supplied, so that I don't have to think about which Python executable to use, but that produced a different error:That error looks like it's revealing a couple of possible bugs:
Since the routine seemed to be able to infer the location of some Python executable, I tried setting
PYO3_PYTHON=python
, but that caused the Microsoft Store to launch, prompting install of Python 3.10, and pyo3 reported yet another error:error: Python script failed
.It would be nice if pyo3 could infer the location more consistently with what a user might expect on Windows, so that most users could rely on a default behavior, similar to how they can for launching Python interactively.
Originally posted by @jaraco in https://github.com/PyO3/pyo3/issues/1616#issuecomment-1305887742