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

virtualenv_starter() does not find python locations with an unusual python version #1704

Open
lschneiderbauer opened this issue Dec 20, 2024 · 2 comments · May be fixed by #1705
Open

virtualenv_starter() does not find python locations with an unusual python version #1704

lschneiderbauer opened this issue Dec 20, 2024 · 2 comments · May be fixed by #1705

Comments

@lschneiderbauer
Copy link

lschneiderbauer commented Dec 20, 2024

The way virtualenv_starter() is currently implemented, python locations with python versions that include characters at the end are discarded.
E.g. a python version with

$ python -EV
3.10.16+PRE

or similar is not recognized.

The reason is probably the use of numeric_version() in the find_starters() function inside virtualenv_starter().

I stumbled across this issue because my company appends a company-branding tag to the python version, and reticulate has problems detecting my python installations.

If you insist on having numeric version, would it be a reasonable solution to trim all the characters in the end before trying to convert to a numeric version?

@t-kalinowski
Copy link
Member

Thanks for reporting.

We could do remove all characters after "+", with something like:

ver <- "3.10.16+PRE"
ver <- sub("\\+.*$", "", ver)
numeric_version(ver, FALSE)

However, the bigger issue is the missing Python prefix from the output. The standard output typically looks like this:

$ python3 -EV
Python 3.13.1

@lschneiderbauer
Copy link
Author

However, the bigger issue is the missing Python prefix from the output.

That was actually a copy&paste mistake, sorry. The actual output is

$ python3 -EV
Python 3.10.16+PRE

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

Successfully merging a pull request may close this issue.

2 participants