# What is the best way to set the path to julia on Windows 10?

**URL:** <https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 17, 2018, 8:53pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467 "2018-10-17T20:53:01Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![w1res](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/w1res/32/588_2.png) [@w1res](https://discourse.julialang.org/u/w1res)\
**Post date:** [October 17, 2018, 8:53pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/1 "2018-10-17T20:53:01Z")

</div>

I just installed Julia 1.0.1. I noticed that the executable wasn’t added to path, so I was wondering what is the best way to add julia to path?

I’m using Windows 10.

I thought about simply adding `C:\Users\NAME\AppData\Local\Julia-1.0.1\bin\julia.exe` because that is what the desktop shortcut is pointing to, but the location has the julia version in it. This means that any time julia is updated, the path will need to be modified again.

1. Is there any better way to add julia to path?
2. I did some searching and couldn’t find a lot of information about adding julia to path. Is there some reason it’s not good to have it on path?

---

<div class="post-metadata">

**Author:** ![Adriel](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Adriel](https://discourse.julialang.org/u/Adriel)\
**Post date:** [October 18, 2018, 2:24am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/2 "2018-10-18T02:24:56Z")

</div>

The windows home directory is not a fun place. To answer question 1: I think you need to adjust the path manually with each update.

Not specifically related to your question, but to make windows a bit less unfriendly I put

```julia
cd("C:/julia-home")
push!(LOAD_PATH, "C:/julia-home")

```

into my `startup.jl`, and work from there. Others may have better solutions.

---

<div class="post-metadata">

**Author:** ![NiclasMattsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niclasmattsson/32/21988_2.png) [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Post date:** [October 18, 2018, 8:13am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/3 "2018-10-18T08:13:15Z")

</div>

> [@w1res](#):
>
> 1. I did some searching and couldn’t find a lot of information about adding julia to path. Is there some reason it’s not good to have it on path?

[Here’s](https://github.com/JuliaLang/julia/pull/29141#issuecomment-422481356) a pretty good reason:

> [@tkelman](#):
>
> Adding julia’s bin folder permanently to your path is an extremely bad idea as that’s where every dependency dll is located. This will break other software that happens to depend on openblas, gmp, etc but requires incompatible versions.

Personally I don’t use other software that have these dependencies, so I add Julia’s `bin` folder to my Windows path anyway (for convenience when working with the Windows command line). I haven’t noticed any side effects in the past year, but YMMV.

---

<div class="post-metadata">

**Author:** ![w1res](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/w1res/32/588_2.png) [@w1res](https://discourse.julialang.org/u/w1res)\
**Post date:** [October 18, 2018, 2:42pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/4 "2018-10-18T14:42:00Z")

</div>

Thanks for the responses. There are actually two reasons I want to add julia to path:

1. If you use the julia shortcut that’s created on the desktop during install, I think it uses powershell. Whatever font is used in powershell doesn’t support all the unicode characters, for example `\xor` shows up as a box with a question mark in it. There is a different terminal I like to use called Hyper, which supports all the characters and has other features I like. If I want to use Hyper, then I need julia on path so I don’t have to type the full exe path every time.
2. Even if I use the default powershell version of julia, it is a pain to browse to the desired working directory. @Adriel’s solution will help with that, but I don’t want to be forced to keep anything juila related in a single location. If julia is on path, then I can right click in any folder I want, open up the terminal at that directory, and then just run `julia`. Otherwise I need to launch julia and browse wherever I want using the terminal, which is much less convenient, especially in a deeply nested folder.

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [October 18, 2018, 2:47pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/5 "2018-10-18T14:47:49Z")

</div>

> [@w1res](#):
>
> I thought about simply adding `C:\Users\NAME\AppData\Local\Julia-1.0.1\bin\julia.exe` because that is what the desktop shortcut is pointing to, but the location has the julia version in it. This means that any time julia is updated, the path will need to be modified again.

An easy way to avoid the need to amend the path with each update is to install Julia in a folder like  
c:\Julia-1.X\   
Then, when a new version comes out, simply install it in the same folder (preferably after an uninstall of the old version).

---

<div class="post-metadata">

**Author:** ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)\
**Post date:** [October 18, 2018, 6:31pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/6 "2018-10-18T18:31:06Z")

</div>

> [@bernhard](#):
>
> > I thought about simply adding `C:\Users\NAME\AppData\Local\Julia-1.0.1\bin\julia.exe` because that is what the desktop shortcut is pointing to, but the location has the julia version in it. This means that any time julia is updated, the path will need to be modified again.

This is exactly what I do.

However, I only add the path to my powershell profile.

Add the following to `Microsoft.Powershell_profile`

```julia
function julia {C:\tools\Julia\julia-1.x\bin\julia.exe $args}

```

---

<div class="post-metadata">

**Author:** ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)\
**Post date:** [October 18, 2018, 6:33pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/7 "2018-10-18T18:33:28Z")

</div>

The default installation path is pretty bad, it should try to install to `program files `, like all other software, or `C:\julia`

---

<div class="post-metadata">

**Author:** ![w1res](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/w1res/32/588_2.png) [@w1res](https://discourse.julialang.org/u/w1res)\
**Post date:** [October 18, 2018, 6:40pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/8 "2018-10-18T18:40:25Z")

</div>

I agree. I can never find anything anymore when it is spread throughout configuration directories, APPDATA, registry, etc.

I might be wrong, but I think the reason things are being installed into local user directories instead of program files is because it gets around system permissions. Some workplaces restrict installations that modify system directories, and rather than having to whitelist a program or get permission, installing it in appdata installs without issues.

---

<div class="post-metadata">

**Author:** ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)\
**Post date:** [October 18, 2018, 6:50pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/9 "2018-10-18T18:50:38Z")

</div>

> [@w1res](#):
>
> I might be wrong, but I think the reason things are being installed into local user directories instead of program files is because it gets around system permissions. Some workplaces restrict installations that modify system directories, and rather than having to whitelist a program or get permission, it will install normally in appdata.

True, but that can be an option during installation and same with an unchecked option to add to path (with a warning, similar to git and anaconda installers).

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [October 18, 2018, 6:59pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/10 "2018-10-18T18:59:11Z")

</div>

> [@musm](#):
>
> The default installation path is pretty bad

100% Agree. There was a discussion ~4 years ago about this but I don’t remember anymore why devs insisted in installing Julia on that dir. I never let it do so and because I also hate dirs with spaces in their names, for me Julia always go to C:\programs\julia-x.x. Than I call it via a batch file that also sets the path.

---

<div class="post-metadata">

**Author:** ![wsphillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsphillips/32/6777_2.png) [@wsphillips](https://discourse.julialang.org/u/wsphillips)\
**Post date:** [April 7, 2019, 7:25pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/11 "2019-04-07T19:25:45Z")

</div>

I know this thread is old, but as a PSA/posterity for people continuing to struggle with this:

Create a new “safe” directory and add it to Windows path (or use an existing one) and put a batch file in your new directory containing:  
`"C:\path\to\julia.exe" %*` and name it “julia.bat” This will sidestep the .dll issue and let you launch julia by just typing it from cmd.exe or powershell. Arguments work too.

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [October 31, 2019, 3:00am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/12 "2019-10-31T03:00:38Z")

</div>

I just kludged together the following power shell script which may be helpful.

The idea is that you put it in a project folder and can run julia with that folder as the working directory just by double clicking the script file. It automatically finds and uses the latest installed version of julia.

```nohighlight
$host.ui.RawUI.WindowTitle = "Julia"

# Use the script directory as the initial working directory
cd $PSScriptRoot

# Find the latest installed version of Julia
$jlpath = dir -Path $Env:LOCALAPPDATA/Julia-* | sort -Property FullName | Select-Object -Last 1 | Join-Path -ChildPath "bin\julia.exe"

# Use current directory as the project directory.
# You may want to remove the --project
iex "$jlpath --project=."

```

side note… coming from knowing bash quite well, powershell sure is unusual. But ever so much saner than .bat files.

---

<div class="post-metadata">

**Author:** ![chadwyck242](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chadwyck242/32/12279_2.png) [@chadwyck242](https://discourse.julialang.org/u/chadwyck242)\
**Post date:** [January 13, 2020, 3:39am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-set-the-path-to-julia-on-windows-10/16467/13 "2020-01-13T03:39:01Z")

</div>

I found leaving the julia.exe off at the end of the path worked:  
C:\Users\your-user-name\AppData\Local\Julia-1.3.1\bin\

When leaving …\julia.exe on the path in Windows 10, it would not recognize it at all. Just ending it with …\bin, when I tried again in Powershell, it worked. Hope this works for the next person who comes upon this discussion someday 😉
