# UndefVarError: not defined

**URL:** <https://discourse.julialang.org/t/undefvarerror-not-defined/91468>\
**Category:** New to Julia\
**Created:** [December 9, 2022, 11:23am UTC](https://discourse.julialang.org/t/undefvarerror-not-defined/91468 "2022-12-09T11:23:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nero](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nero](https://discourse.julialang.org/u/nero)\
**Post date:** [December 9, 2022, 11:23am UTC](https://discourse.julialang.org/t/undefvarerror-not-defined/91468/1 "2022-12-09T11:23:42Z")

</div>

Hello  
I always get this error when I run .jl files. I tried windows and ubuntu but still same error.  
UndefVarError: (name of .jl file) not defined

Could you please advise  
Thanks

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [December 9, 2022, 11:26am UTC](https://discourse.julialang.org/t/undefvarerror-not-defined/91468/2 "2022-12-09T11:26:53Z")

</div>

Can you please post the exact code you’re trying to run which results in an error? I feel like you’re missing to put the path inside quotes to make it a string, but I don’t really know what you’re doing.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 9, 2022, 11:29am UTC](https://discourse.julialang.org/t/undefvarerror-not-defined/91468/3 "2022-12-09T11:29:57Z")

</div>

You need to pass the filepath as a string:

```julia
julia> include(myfile.jl)
ERROR: UndefVarError: `myfile` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[197]:1

julia> include("myfile.jl")
ERROR: SystemError: opening file "...\\myfile.jl": No such file or directory

```

---

<div class="post-metadata">

**Author:** ![nero](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nero](https://discourse.julialang.org/u/nero)\
**Post date:** [December 9, 2022, 12:21pm UTC](https://discourse.julialang.org/t/undefvarerror-not-defined/91468/4 "2022-12-09T12:21:38Z")

</div>

Thank you so much it worked
