# Startup.jl not running

**URL:** <https://discourse.julialang.org/t/startup-jl-not-running/97232>\
**Category:** New to Julia\
**Created:** [April 7, 2023, 7:24pm UTC](https://discourse.julialang.org/t/startup-jl-not-running/97232 "2023-04-07T19:24:06Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [April 10, 2023, 3:11pm UTC](https://discourse.julialang.org/t/startup-jl-not-running/97232/21 "2023-04-10T15:11:59Z")

</div>

Uh, it looks like the three backquotes before and after is the trick to get block quotes; is there any docs on using this site? Anyways, now that block quotes are working, here is my ~/.julia/config/startup.jl

```julia
import Pkg
println("In ~/.julia/config/startup.jl")
let
    pkgs = ["Revise", "Debugger", "PyPlot", "BenchmarkTools", "Random", "PyCall",
    "Statistics", "MAT", "Printf", "Random"]
    for pkg in pkgs
      if Base.find_package(pkg) === nothing
          Pkg.add(pkg)
      end
    end
end

using Debugger, PyPlot, Printf
try
    using Revise
catch e
    @warn "Error initializing Revise" exception=(e, catch_backtrace())
end

print("\nHello, startup.jl from ~/.julia/config has just been run\n")
println("Setup successful")

```

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [April 10, 2023, 3:59pm UTC](https://discourse.julialang.org/t/startup-jl-not-running/97232/22 "2023-04-10T15:59:52Z")

</div>

HI,

- if you compare lines 3 and 4 in your startup – the difference is exactly that line 3 has quote marks ( `“ `and `”`) as opposed to line 4 which has “poor mans quotes” or in other words the “inch” character as limiters for a string. Line 3 might have been changed by an advanced text editor, but is no longer right Julia code, since `“...”`is not how to delimit a string `"..."`is.

- Concerning the three backticks – that is not a quote/blockquote but a code environment, i.e. all stuff between that is set as code (the same for single backticks in running text like ``code`` is set as `code`. A block quote would need all lines prepended with a `>`so (yay we can illustrate code env directly)

- Concnering the order. All I could find anywhere was the location `~/.julia/config/startup.jl`. But it might be (have not found that yet) that your first file takes priority over the local one? Since that only contains a line _calling_ the local one you could try to rename/remove the global one (your first) one and then check whether it runs you local one?

_edit:_ You could try this command [How do I open and edit my startup.jl file? - #3 by ianshmean](https://discourse.julialang.org/t/how-do-i-open-and-edit-my-startup-jl-file/93415/3) and see which file opens?

_edit2:_ Did you by any chance set the `JULIA_DEPOT_PATH`? See [https://docs.julialang.org/en/v1/manual/command-line-options/](https://docs.julialang.org/en/v1/manual/command-line-options/) the `startup-file` command line option, if that is not set it should load your local one.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [April 10, 2023, 5:05pm UTC](https://discourse.julialang.org/t/startup-jl-not-running/97232/23 "2023-04-10T17:05:54Z")

</div>

> [@kw\_martin](#):
>
> can’t tell until I submit the reply

There should be a preview button, as is common for markdown formatted forums.

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [April 13, 2023, 4:35pm UTC](https://discourse.julialang.org/t/startup-jl-not-running/97232/24 "2023-04-13T16:35:39Z")

</div>

> [@kw\_martin](#):
>
> `# include(“/home/martin/.julia/config/startup.jl”)`

But line 3:

```julia
# include(“/home/martin/.julia/config/startup.jl”)

```

Is a comment line so the quotes in it should have no effect? Re not running startup.jl: kellertuer, thank you for your excellent suggestions and help, and the time it took you to reply. The problem was JULIA\_DEPOT\_PATH was set, and it turns out only the first entry of DEPOT\_PATH is checked to see if it contains a startup.jl file. This is not mentioned in the documentation re JULIA\_DEPOT\_PATH. For example:

```julia
julia> DEPOT_PATH
4-element Vector{String}:
 "/home/Dropbox/programming/julia/JuliaFiles/"
 "/home/martin/.julia"
 "/home/Dropbox/Julia/julia-1.8.5/local/share/julia"
 "/home/Dropbox/Julia/julia-1.8.5/share/julia"

```

~/.julia/config/startup.jl is not run, but:

```julia
julia> DEPOT_PATH
3-element Vector{String}:
 "/home/martin/.julia"
 "/home/Dropbox/Julia/julia-1.8.5/local/share/julia"
 "/home/Dropbox/Julia/julia-1.8.5/share/julia"

julia> 

```

~/.julia/config/startup.jl is run. I think this is a place where the documentation can be improved. I still can’t find the “preview” link which could also help. Still, I now understand how to start julia, and can go on to understanding how to run it, such as why:

```julia
includet("SimCirc.jl")

```

gives an error on the @printf macro, but if I do:

```julia
include("SimCirc.jl")
includet("SimCirc.jl")

```

I don’t get the error; but that’s a topic for another day. I sincerely thank everyone for the help on getting startup.jl to run; topic closed.

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [April 13, 2023, 4:55pm UTC](https://discourse.julialang.org/t/startup-jl-not-running/97232/25 "2023-04-13T16:55:38Z")

</div>

If you type `? DEPOT_PATH` in REPL or take a look at [Constants · The Julia Language](https://docs.julialang.org/en/v1/base/constants/#Base.DEPOT_PATH)

it specifically mentions

> The first entry is the “user depot” and should be writable by and owned by the current user. The user depot is where: registries are cloned, new package versions are installed, named environments are created and updated, package repos are cloned, newly compiled package image files are saved, log files are written, development packages are checked out by default, and global configuration data is saved. Later entries in the depot path are treated as read-only and are appropriate for registries, packages, etc. installed and managed by system administrators.

the importance and role of the first folder over the second and all following ones.

For your preview question – When I type my answers here I have an editor window on the left and to the right of that a preview (well now its hidden behind the “this topic has been answered” message that you can close.

For the further problems – let’s maybe not turn this into “The thread that answers quite a few questions.” – that is a question for another day but maybe even more for another thread/topic here on Discourse. Also because I have no clue what your `SimCirc.jl` contains.

[Previous page](https://discourse.julialang.org/t/startup-jl-not-running/97232.md?page=1)
