# Running Julia script with predefined environment

**URL:** <https://discourse.julialang.org/t/running-julia-script-with-predefined-environment/35997>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [March 15, 2020, 1:15am UTC](https://discourse.julialang.org/t/running-julia-script-with-predefined-environment/35997 "2020-03-15T01:15:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arvindmohan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arvindmohan/32/13402_2.png) [@arvindmohan](https://discourse.julialang.org/u/arvindmohan)\
**Post date:** [March 15, 2020, 1:15am UTC](https://discourse.julialang.org/t/running-julia-script-with-predefined-environment/35997/1 "2020-03-15T01:15:25Z")

</div>

Julia newbie here. I downloaded a package with Project.toml and instantiated the environment in Julia interactively so all deps were installed. Now I need to run a script (here, testing.jl) thru command line in _this environment_. Is this the correct usage?

```julia
julia --project=envName testing.jl

```

envName is the name I declared for the project. I am still getting ERROR: LoadError: UndefVarError: for some methods, while I know that the corresponding packages have been installed. Would appreciate any help.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 15, 2020, 8:27am UTC](https://discourse.julialang.org/t/running-julia-script-with-predefined-environment/35997/2 "2020-03-15T08:27:49Z")

</div>

There is probably some error in your code, but it is hard to be more specific without an MWE.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757/):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![arvindmohan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arvindmohan/32/13402_2.png) [@arvindmohan](https://discourse.julialang.org/u/arvindmohan)\
**Post date:** [March 21, 2020, 1:07am UTC](https://discourse.julialang.org/t/running-julia-script-with-predefined-environment/35997/3 "2020-03-21T01:07:23Z")

</div>

I see - I’ll look into it. Is the syntax correct though? I just want to make sure of that. Thanks!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 21, 2020, 6:43am UTC](https://discourse.julialang.org/t/running-julia-script-with-predefined-environment/35997/4 "2020-03-21T06:43:00Z")

</div>

If `envName` is a valid project directory then that part should work.
