Skip to content

PYTHON_JULIACALL_BINDIR not effective? #619

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

Open
xgdgsc opened this issue May 29, 2025 · 7 comments
Open

PYTHON_JULIACALL_BINDIR not effective? #619

xgdgsc opened this issue May 29, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@xgdgsc
Copy link

xgdgsc commented May 29, 2025

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?

Image

Your system
linux centos 7

Additional context
Add any other context about the problem here.

@xgdgsc xgdgsc added the bug Something isn't working label May 29, 2025
@xgdgsc
Copy link
Author

xgdgsc commented May 29, 2025

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 ?

@cjdoris
Copy link
Collaborator

cjdoris commented May 29, 2025

Ah the docs maybe aren't clear, if you are trying to use a pre-installed Julia, set PYTHON_JULIAPKG_EXE.

@xgdgsc
Copy link
Author

xgdgsc commented May 29, 2025

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?

@cjdoris
Copy link
Collaborator

cjdoris commented May 29, 2025

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.

@cjdoris
Copy link
Collaborator

cjdoris commented May 29, 2025

Thinking a bit more:

  • Setting PYTHON_JULIAPKG_EXE will use a specific Julia, so won't download one.
  • Setting PYTHON_JULIAPKG_OFFLINE=yes will 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_PROJECT to its path.
  • Possibly set JULIA_DEPOT if your depot is not in the default place.

@cjdoris
Copy link
Collaborator

cjdoris commented May 29, 2025

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.

@cjdoris
Copy link
Collaborator

cjdoris commented May 29, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants