PYTHON_JULIACALL_BINDIR not effective?
Affects: JuliaCall
From my understanding it still tries to connect the internet when call
https://github.com/JuliaPy/PythonCall.jl/blob/0a7d49f274147e9876fee47981d9aa5459f6eb8c/pysrc/juliacall/init.py#L160C44-L160C54 ?
Describe the bug
PYTHON_JULIACALL_BINDIR not effective. It still tries to connect the internet and install julia?
Your system linux centos 7
Additional context Add any other context about the problem here.
I don' t understand why doing from juliacall import Main as jl would make it trying things online? Can we just make it totoally offline when importing and only do online stuff with juliapkg ?
Ah the docs maybe aren't clear, if you are trying to use a pre-installed Julia, set PYTHON_JULIAPKG_EXE.
Thanks for the tip. Is there a way to import without any attempt to do online staff? I want to share a depot to other python user on same machine without any knowledge of julia to use a self hosted git master julia package. What' s the recommended way to do something like this now?
I've not had to do that before so not sure, but some combination of PYTHON_JULIAPKG_EXE, PYTHON_JULIAPKG_PROJECT, PYTHON_JULIAPKG_OFFLINE, JULIA_DEPOT might help.
For a bit on how juliapkg works: it will only download things if it needs to, namely it downloads Julia if you don't have a compatible version already and it downloads packages when dependencies change. So if you resolve once it will not go online again unless any of your dependencies change.
So one way to solve your problem would be to resolve once and then copy the whole filesystem state to your offline system.
Let me know if you figure it out - would be good to add this to the FAQs.
Thinking a bit more:
- Setting
PYTHON_JULIAPKG_EXEwill use a specific Julia, so won't download one. - Setting
PYTHON_JULIAPKG_OFFLINE=yeswill prevent any packages from being downloaded. - However this means the Julia project used will not have any packages. So you should create the project you need yourself and set
PYTHON_JULIAPKG_PROJECTto its path. - Possibly set
JULIA_DEPOTif your depot is not in the default place.
If what you actually want is to have a read-only depot but let people create their own projects from it while offline, that may require some changes to juliapkg.
I think I'm going to change how offline mode behaves in juliapkg. Instead of just skipping installing packages entirely, I'll change it to do the same package install steps but with Julia's package manager in offline mode so it can install already-downloaded packages.