问题
How to correctly configure Julia portable or stanalone, For everything to happen from the external storage USB drives: Add, update packages ? In Julia's helps is there any procedure?
This is what happens to me after running the .bat file. From the USB flash I still have reference to the installation of Julia in C:
回答1:
All you need to do is to configure your JULIA_DEPOT_PATH
.
This is the place where Julia is installing it's packages and holding pre-compiled codes.
Assume your installation (USB drive) is D:\
and you unzip Julia to D:\Julia1.5.0
mkdir D:\JuliaPkg1.5.0
set PATH=D:\Julia1.5.0\bin;%PATH%
set JULIA_DEPOT_PATH=D:\JuliaPkg1.5.0
julia
Now you are ready to install the packages etc.
回答2:
Thanks to the answer of Przemyslaw Szufel and the link
The final solution is the following: File batch windows
@echo off
set myDIR=%~d2\SA_Ptbls\julia-1.5.0-win64
if not exist %myDIR% (mkdir %myDIR%)
set PATH=%~d2\SA_Ptbls\julia-1.5.0-win64\julia-1.5.0\bin;%PATH%
set JULIA_DEPOT_PATH=%~d2\SA_Ptbls\julia-1.5.0-win64
julia
- % ~ d2 gives you the current drive letter when connect the USB drive to another computer (the drive letters change!!!)
- if not exist% myDIR% (mkdir% myDIR%) checks if the subdirectory exists, if it does not exist it creates it
When executing the batch file, we successfully obtain:
And to run the batch file from a shortcut. After creating the shortcut it was configured as shown:
I did not achieve that in the status bar when executing the batch file the Julia icon was shown; and instead shows the WindowsPowerShell icon:
来源:https://stackoverflow.com/questions/63417499/how-to-properly-configure-julia-portable-or-standalone