Installing Julia in Windows Environment with No Internet

Hi all,

I need to install Julia to a Windows environment that does not have an internet connection. I can prepare the installation outside of this environment but then need to transfer the installation to the space. I wanted to install the following packages prior to moving it into the space:

  1. DataFrames
  2. BenchmarkTools
  3. PyCall
  4. Revise
  5. TerminalPager
  6. CSV
  7. XLSX
  8. OhMyREPL

Does anyone have any suggestions on how I can accomplish both preparing a Julia installation, installing the packages in the default Julia environment, and then moving Julia into the Windows space?

Thank you!

~ tcp :deciduous_tree:

1 Like

Would I want to build a custom Julia image with these packages bundled into it? Is that a possible solution/option here?

1 Like

Upon further investigation, I found this Discourse link: Offline installation of Julia packages - #16 by wulpuqu

Are the methods laid out towards the of that discussion still valid?

1 Like

Update! I believe I found the solution to this problem courtesy of @heetbeet! It seems really great and will report back my work with it. :slight_smile:

Here is the solution: GitHub - heetbeet/juliawin: A portable Julia for Windows, bundled with VSCode, Pluto, Conda & PyCall, and more.

Update: Updating the JULIA_DEPOT_PATH is also important to do for full portability: Change location of .julia

2 Likes

Have you seen @PetrKryslUCSD’s post here?

(Also look at the following comments that include an updated version).

Hi,

I had to do something similar recently and made use of PackageCompiler.jl with a lot of success.

You will have to configure your package dependencies (in VSCode activate the parent directory then do Pkg.add in the repl). before running the PackageCompiler commands but the outcome is an .exe with all the dependencies as .dlls. I did have to run it a few times, modifying for every missing package (some core dependencies like xtsd_jll were missing for some reason).

This suited my needs to distribute Julia without Julia and provided fully compiled code. The only drawback was that it doesn’t yet support setting the number of threads; but this is mitigated with environment variables.

Regards,

2 Likes

PackageCompiler.jl’s create_sysimage() is great for this! You can just swap out Julia’s default sysimage and have a fully-featured Julia session with whatever packages you need. Most packages nowadays are fully relocatable, and this should only require a single compilation, though packages with lazy-loading need to be specified manually. I’ve written a tutorial on this, and while I’ve never tried setting up a Windows environment this way, it seems possible, and this could be useful to others.

1 Like

In theory this should “just work” and I love this solution. However, what becomes the problem is targeting the target architecture where the sysimage will be actually run. Like creating a sysimage on OSX architecture does not automatically permit it to run on a windows machine. Did you get aruond that issue? Also, didn’t realize you were at BCBI @Ashlin_Harris ! Great to see more Julians popping up in the Biomedical spaces!

1 Like

You’re right, the sysimage is built based on Manifest.toml, so it needs to be done on a computer with the same architecture. This approach works best for secure systems that also have a build server.

Well, that’s not so bad – I wonder if we have a staging/build environment. If so, this may quite possibly be a very powerful and great solution. Thanks for sharing thoughts here, this is really great frankly speaking!