Offline installation of packages

Hello,
I am new to Julia and I am trying to use a package already developed by others in a computing cluster that does not allow Julia to connect to the internet/Github.
As I install the package and try to use it, Julia detects dependencies and try to download the software without success.
Is there any option to install the packages required that have been previously downloaded in other machines?
I tried this by installing the package in another cluster with the same architecture in which Julia is allowed to connect to the outside network (no problem with this) and copying the .julia directory to the other clsuter, but I couldn’t get Julia running my package.

Any idea?
Thanks in advance,
Edi

1 Like

That seems like a reasonable idea. What was the exact failure you experienced in that case?

Well, I tried this in several ways:

Tried to transfer only the packages sub-directory from .julia. I tried with packages, artifacts, registries…

It seems that always tries to connect to internet and some failures in compiling Conda. There is some information of paths from the machine at which the packages were downloaded.

See below. I changed the old paths to OLDPATH and the new to NEWPATH.

           _

_ _ ()_ | Documentation: https://docs.julialang.org
() | () () |
_ _ | | __ _ | Type “?” for help, “]?” for Pkg help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 1.4.2 (2020-05-23)
/ |_’|||_’_| | Official https://julialang.org/ release
|__/ |

julia> modes()
[ Info: Precompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]
ERROR: LoadError: ArgumentError: Path to conda environment is not valid: OLDPATH
Stacktrace:
[1] prefix(::String) at NEWPATH/.julia/packages/Conda/sNGum/src/Conda.jl:41
[2] top-level scope at NEWPATH/.julia/packages/Conda/sNGum/src/Conda.jl:46
[3] include(::Module, ::String) at ./Base.jl:377
[4] top-level scope at none:2
[5] eval at ./boot.jl:331 [inlined]
[6] eval(::Expr) at ./client.jl:449
[7] top-level scope at ./none:3
in expression starting at NEWPATH
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
[3] _require(::Base.PkgId) at ./loading.jl:1029
[4] require(::Base.PkgId) at ./loading.jl:927
[5] require(::Module, ::Symbol) at ./loading.jl:922
[6] include(::Module, ::String) at ./Base.jl:377
[7] top-level scope at none:2
[8] eval at ./boot.jl:331 [inlined]
[9] eval(::Expr) at ./client.jl:449
[10] top-level scope at ./none:3
in expression starting at NEWPATH/.julia/packages/PyCall/BD546/src/PyCall.jl:31
ERROR: LoadError: Failed to precompile PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] to NEPATH/.julia/compiled/v1.4/PyCall/GkzkC_l4nbf.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
[3] _require(::Base.PkgId) at ./loading.jl:1029
[4] require(::Base.PkgId) at ./loading.jl:927
[5] require(::Module, ::Symbol) at ./loading.jl:922
[6] include(::Module, ::String) at ./Base.jl:377
[7] top-level scope at none:2
[8] eval at ./boot.jl:331 [inlined]
[9] eval(::Expr) at ./client.jl:449
[10] top-level scope at ./none:3
in expression starting at NEWPATH/.julia/packages/PyPlot/XHEG0/src/PyPlot.jl:4
Updating registry at ~/.julia/registries/General
Resolving package versions…
Downloading artifact: FFMPEG

Ah, ok. Yeah, this is a trickier case, since you’re using the Julia package manager to manage Conda, which is its own package manager entirely (it’s package managers all the way down…).

You might have an easier time debugging this if you can limit yourself to a single package manager (just Julia, no Conda) at a time. The stacktrace you posted is for PyPlot. Do you need any other Python packages, or is that the only one? If the only Python stuff you’re doing is PyPlot, perhaps you could temporarily switch to another tool (like Plots.jl) which doesn’t require managing a Python installation too?