You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, both venv and conda create environments containing only a python executable, not python3, python3.x, or py. So if py is not otherwise on the PATH, Chaquopy will fail to find any Python executable.
In the case of venv environments, a plain py (found in C:\Windows) is somehow able to detect that it's in a virtual environment and use that environment's Python. This doesn't work in a conda environment, although conda users are less likely to have the py launcher installed at all. In any case, Chaquopy never runs py on its own, it always runs py -3 or py -3.x, which apparently ignore the current environment.
The simplest solution is probably to just use python as a final fallback on both Windows and Unix. If it turns out to be Python 2, I believe we still maintain compatible syntax in all the build scripts, and we have integration tests to verify they produce clear error messages.
This does mean it may choose a mismatching py -3 version even if the current environment's python happens to have the correct version. But the only way to fix that would be to make the Gradle plugin do more complex version detection, e.g. by running a test script with python -c. That isn't worth the effort just now, especially since most users seem happy enough just using buildPython to work around any corner cases.
The text was updated successfully, but these errors were encountered:
Chaquopy version
13.0.0
Describe your issue
On Windows, both venv and conda create environments containing only a
python
executable, notpython3
,python3.x
, orpy
. So ifpy
is not otherwise on the PATH, Chaquopy will fail to find any Python executable.In the case of venv environments, a plain
py
(found in C:\Windows) is somehow able to detect that it's in a virtual environment and use that environment's Python. This doesn't work in a conda environment, although conda users are less likely to have thepy
launcher installed at all. In any case, Chaquopy never runspy
on its own, it always runspy -3
orpy -3.x
, which apparently ignore the current environment.The simplest solution is probably to just use
python
as a final fallback on both Windows and Unix. If it turns out to be Python 2, I believe we still maintain compatible syntax in all the build scripts, and we have integration tests to verify they produce clear error messages.This does mean it may choose a mismatching
py -3
version even if the current environment'spython
happens to have the correct version. But the only way to fix that would be to make the Gradle plugin do more complex version detection, e.g. by running a test script withpython -c
. That isn't worth the effort just now, especially since most users seem happy enough just usingbuildPython
to work around any corner cases.The text was updated successfully, but these errors were encountered: