# Julia Portable Mode o Standalone

**URL:** <https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913>\
**Category:** New to Julia\
**Created:** [August 14, 2020, 6:18am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913 "2020-08-14T06:18:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [August 14, 2020, 6:18am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/1 "2020-08-14T06:18:28Z")

</div>

Hello, How to correctly configure Julia standalone,  
For everything to happen from the external storage USB drives: Add, update packages !!!?  
In the site [VSC portable](https://code.visualstudio.com/docs/editor/portable), you can read how to configure VSC (Visual Studio Code) so that it works in such mode.  
Is there something similar for Julia?

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [August 14, 2020, 8:28am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/2 "2020-08-14T08:28:43Z")

</div>

I have not tried myself, but I’d say that all you need is to set the [JULIA\_DEPOT\_PATH](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_DEPOT_PATH-1) environment variable to somewhere in the USB drive where you have Julia installed, before starting Julia.

If you want to use your portable installation of VSC with the Julia extension, you should also configure the extension to run Julia from the USB drive.

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [August 14, 2020, 8:36am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/3 "2020-08-14T08:36:36Z")

</div>

Please show me how to do it !!  
How to set the JULIA\_DEPOT\_PATH?  
Julia currently runs Portable Mode or Standalone from a folder on the PC,  
_ **“C: \ Users \ hermesr \ Documents \ Julia software”** _

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [August 14, 2020, 9:00am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/4 "2020-08-14T09:00:17Z")

</div>

It depends on the operating system. It looks like you are using Windows, so you could make a `julia.bat` file with the commands:

```julia
set JULIA_DEPOT_PATH = path\to\somewhere\in\the\usb\drive
start \path\to\julia\executable

```

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [August 14, 2020, 12:21pm UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/5 "2020-08-14T12:21:53Z")

</div>

If you’re on Windows, have a look at my post - [Guide: How to Create a Portable Julia Pro Installation for Windows](https://discourse.julialang.org/t/guide-how-to-create-a-portable-julia-pro-installation-for-windows/29831).

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [August 17, 2020, 7:36am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/6 "2020-08-17T07:36:27Z")

</div>

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:

 ![myJulia.bat](https://global.discourse-cdn.com/julialang/original/3X/4/d/4d9798b1c5eb45acffcfd4c28137e6a77834dd36.jpeg)

How should I proceed?  
the bat file is the one recommended above:

```julia
set PATH=F:\SA_Ptbls:\Julia1.5.0\bin;%PATH%
set JULIA_DEPOT_PATH=F:\SA_Ptbls\julia-1.5.0-win64

```

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [August 18, 2020, 7:54am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/7 "2020-08-18T07:54:01Z")

</div>

The final batch file is as follows, thanks to the answer of [Przemyslaw Szufel](https://stackoverflow.com/a/63421115/8409550) and the [link](https://discourse.julialang.org/t/where-or-how-to-edit-depot-path/13501/15):

```julia
@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

```

When executing the batch file, we obtain:

 ![Julia_PortableOk](https://global.discourse-cdn.com/julialang/original/3X/e/2/e2590b9145336a683b756c6baa083b5c58470ee2.jpeg)  
the batch file can be run from a shortcut, after being configured as shown:  
 ![ShortcutJuliaOk](https://global.discourse-cdn.com/julialang/original/3X/3/8/38472143771e61ac1dc2d256712d194a7a455797.jpeg)

---

<div class="post-metadata">

**Author:** ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Post date:** [December 15, 2021, 11:12am UTC](https://discourse.julialang.org/t/julia-portable-mode-o-standalone/44913/8 "2021-12-15T11:12:26Z")

</div>

> [@HerAdri](#):
>
> The final batch file is as follows, thanks to the answer of [Przemyslaw Szufel](https://stackoverflow.com/a/63421115/8409550) and the [link](https://discourse.julialang.org/t/where-or-how-to-edit-depot-path/13501/15):
> 
> ```julia
> @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
> 
> ```
> 
> When executing the batch file, we obtain:
> 
> ![Julia_PortableOk](https://global.discourse-cdn.com/julialang/original/3X/e/2/e2590b9145336a683b756c6baa083b5c58470ee2.jpeg)  
> the batch file can be run from a shortcut, after being configured as shown:  
> ![ShortcutJuliaOk](https://global.discourse-cdn.com/julialang/original/3X/3/8/38472143771e61ac1dc2d256712d194a7a455797.jpeg)

This is not sufficient in case you would like to use “PyCall” and “Conda”.  
The Conda environment is put in your user profile folder (sub folder below %HOMEPATH%).  
Something is written [here](https://github.com/JuliaPy/PyCall.jl/issues/890) and [here](https://github.com/heetbeet/juliawin/blob/main/bin/activate-juliawin-portability.bat).
