# “using” expression not at top level

**URL:** <https://discourse.julialang.org/t/using-expression-not-at-top-level/40657>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 3, 2020, 10:21am UTC](https://discourse.julialang.org/t/using-expression-not-at-top-level/40657 "2020-06-03T10:21:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stv1314](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stv1314/32/15341_2.png) [@stv1314](https://discourse.julialang.org/u/stv1314)\
**Post date:** [June 3, 2020, 10:21am UTC](https://discourse.julialang.org/t/using-expression-not-at-top-level/40657/1 "2020-06-03T10:21:06Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/4/6/46a16bd5c797400068e5b33f8f28881e3a79b369.png)  
Can any body tell me what’s wrong with this?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 3, 2020, 10:29am UTC](https://discourse.julialang.org/t/using-expression-not-at-top-level/40657/2 "2020-06-03T10:29:42Z")

</div>

You can not `using` packages inside functions, move the `using` statements outside the function body.

---

<div class="post-metadata">

**Author:** ![stv1314](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stv1314/32/15341_2.png) [@stv1314](https://discourse.julialang.org/u/stv1314)\
**Post date:** [June 3, 2020, 11:57am UTC](https://discourse.julialang.org/t/using-expression-not-at-top-level/40657/3 "2020-06-03T11:57:23Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/f/e/fe16cae79f2bfb35977d1729f3f341cd837edd19.jpeg) Though I put “using”outside of the function,it shows the same error

---

<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:** [June 3, 2020, 12:13pm UTC](https://discourse.julialang.org/t/using-expression-not-at-top-level/40657/4 "2020-06-03T12:13:36Z")

</div>

Please post quoted code, and provide 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:** ![ppalmes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ppalmes/32/6838_2.png) [@ppalmes](https://discourse.julialang.org/u/ppalmes)\
**Post date:** [June 5, 2020, 6:55am UTC](https://discourse.julialang.org/t/using-expression-not-at-top-level/40657/5 "2020-06-05T06:55:11Z")

</div>

you can by `@eval using Package`
