Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaquopy can't find buildPython in Windows venv or conda environments #752

Closed
mhsmith opened this issue Nov 21, 2022 · 1 comment
Closed
Labels
Milestone

Comments

@mhsmith
Copy link
Member

mhsmith commented Nov 21, 2022

Chaquopy version

13.0.0

Describe your issue

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.

@mhsmith
Copy link
Member Author

mhsmith commented Nov 21, 2022

Related: #733.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant