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

Fix install for Julia <=1.6 #188

Merged
merged 11 commits into from Sep 8, 2022
Merged

Fix install for Julia <=1.6 #188

merged 11 commits into from Sep 8, 2022

Conversation

MilesCranmer
Copy link
Owner

If the Julia project is a shared env, the variable JULIA_PROJECT will only be set to @pysr-{version} if Julia >= 1.7. Otherwise, it will not be set, and the activation performed explicitly.

This also includes a cleaner version check which doesn't require Julia to be started.

@mkitti do you think you could take a look at this?

@mkitti
Copy link
Contributor

mkitti commented Sep 7, 2022

The work around here is to give the an absolute path as the JULIA_PROJECT

@MilesCranmer
Copy link
Owner Author

Any idea how to get that information in an OS-independent way, without loading Julia? I took a look in JuliaInfo.load() but there doesn't seem to be any relevant paths.

@mkitti
Copy link
Contributor

mkitti commented Sep 7, 2022

We could use subprocess.

>>> import subprocess
>>> julia_home = subprocess.run(["julia", "-e print(homedir())"], capture_output=True).stdout.decode()
>>> julia_home
'C:\\Users\\kittisopikulm'
>>> julia_env_dir = subprocess.run(["julia", "-e using Pkg; print(Pkg.envdir())"], capture_output=True).stdout.decode()
>>> julia_env_dir
'C:\\Users\\kittisopikulm\\.julia\\environments'

@MilesCranmer
Copy link
Owner Author

Good idea, thanks

@MilesCranmer
Copy link
Owner Author

Cool, it's working! Thanks @mkitti!

@MilesCranmer MilesCranmer merged commit 5fa8a27 into master Sep 8, 2022
@MilesCranmer MilesCranmer deleted the fix-julia-1-6 branch September 8, 2022 01:23
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 this pull request may close these issues.

None yet

2 participants