# With or without module prefix?

**URL:** <https://discourse.julialang.org/t/with-or-without-module-prefix/110612>\
**Category:** New to Julia\
**Created:** [February 22, 2024, 11:27pm UTC](https://discourse.julialang.org/t/with-or-without-module-prefix/110612 "2024-02-22T23:27:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Post date:** [February 22, 2024, 11:27pm UTC](https://discourse.julialang.org/t/with-or-without-module-prefix/110612/1 "2024-02-22T23:27:22Z")

</div>

I see codes like

```julia
using Plots
x = range(0, 2π; length = 100)
y = sin.(x)
plot(x, y)

```

and also codes like

```julia
julia> using Random

julia> using Random: seed!

julia> seed!(1234);

julia> rand(2)
2-element Vector{Float64}:
 0.32597672886359486
 0.5490511363155669

julia> seed!(1234);

julia> rand(2)
2-element Vector{Float64}:
 0.32597672886359486
 0.5490511363155669

```

In the first case, we write simply ‘plot’ not ‘Plots.plot’, but in the second case, we have the extra line

```julia
using Random: seed!

```

to write simply ‘seed!’ instead of ‘Random.seed!’.

Why?

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [February 22, 2024, 11:30pm UTC](https://discourse.julialang.org/t/with-or-without-module-prefix/110612/2 "2024-02-22T23:30:47Z")

</div>

You need to pull `seed!` explicitly because it is not `export`ed.

```julia
julia> using Random

julia> seed!
ERROR: UndefVarError: `seed!` not defined

```

---

<div class="post-metadata">

**Author:** ![adienes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adienes/32/37459_2.png) [@adienes](https://discourse.julialang.org/u/adienes)\
**Post date:** [February 22, 2024, 11:31pm UTC](https://discourse.julialang.org/t/with-or-without-module-prefix/110612/3 "2024-02-22T23:31:34Z")

</div>

I recommend reading [Modules · The Julia Language](https://docs.julialang.org/en/v1/manual/modules/#modules)

In general, the “default” is that you must use the module prefix. however, if the module has chosen to `export` a name then it will be available after `using ThePackage`

---

<div class="post-metadata">

**Author:** ![mike.ingold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike.ingold/32/203749_2.png) [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Post date:** [February 23, 2024, 12:25am UTC](https://discourse.julialang.org/t/with-or-without-module-prefix/110612/4 "2024-02-23T00:25:09Z")

</div>

Adding onto the previous responses: if you `using` more than one package that both `export` the same name and you intend to use one of them, then you’ll either have to specify the full `PackageA.exportedname` at each usage or `using PackageA: exportedname` to eliminate the ambiguity.
