# Problem with module dependencies in Pluto

**URL:** <https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882>\
**Category:** Pluto\
**Tags:** packages, pluto\
**Created:** [December 20, 2022, 1:34am UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882 "2022-12-20T01:34:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 20, 2022, 1:34am UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882/1 "2022-12-20T01:34:14Z")

</div>

I created a module, myModule, that requires the Dates and DataFrames packages.  
Fwiw, my src directory contains only myModule.jl which looks like:

```julia
module myModule
  using DataFrames, Dates
  export myDF
  
  function myDF()
      df = DataFrame(a = [1, 2, 3], b = [4, 5, 6], c = [today(), today() + Day(1), today() + Day(2)])
      return df
  end
end # module myModule

```

and my Project.toml file looks like

```julia
name = "myModule"
uuid = "c3019312-639c-46e1-a276-88058c088531"
authors = ["ADANNENBERG <alex.dannenberg@gmail.com>"]
version = "0.1.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

```

The command

```julia
using myModule

```

is sufficient for the module to work in the REPL or in VS Code, i.e. sufficient to make the exported function myDF() work fine in the REPL or VS Code.

In Pluto, however, it appears that the “using DataFrames, Dates” line in myModule is not used or recognized. Instead, when I’m in Pluto I have to use the command

```julia
using myModule, DataFrames, Dates

```

in order not to throw an error.

This was a toy example, but it’s true for every module I’ve created: In the REPL or VS Code I just have to have a line “using moduleName” and all the exported functions in the module work fine. But in Pluto “using moduleName” will bug and tell me that the packages that moduleName depends upon are not found. In Pluto I can only make moduleName work if I have the line “using moduleName, Dates, DataFrames”…

Is this a feature of Pluto, or a sign that I’ve got a problem in myModule that doesn’t cause the REPL or VS Code to bug?

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [December 20, 2022, 6:32pm UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882/2 "2022-12-20T18:32:49Z")

</div>

you might be better off finding the Plutonians on Discord

> **[GitHub - fonsp/Pluto.jl: 🎈 Simple reactive notebooks for Julia](https://github.com/fonsp/Pluto.jl#you-can-chat-with-us)**
>
> 🎈 Simple reactive notebooks for Julia. Contribute to fonsp/Pluto.jl development by creating an account on GitHub.

It might also be worth reading about Pluto’s own package management: ([📦 Packages — Pluto.jl](https://plutojl-preview.netlify.app/docs/packages/))

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 20, 2022, 6:36pm UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882/3 "2022-12-20T18:36:56Z")

</div>

Thanks, I will give it a shot…

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [December 20, 2022, 6:45pm UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882/4 "2022-12-20T18:45:37Z")

</div>

First thing i usually do in a notebook is

```julia
begin
    import Pkg
    Pkg.activate()
    using …
end

```

because I’m no good at sharing 😂

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 20, 2022, 6:52pm UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882/5 "2022-12-20T18:52:28Z")

</div>

Thanks, that works. Can you explain why in simple terms?

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [December 20, 2022, 6:58pm UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882/6 "2022-12-20T18:58:47Z")

</div>

Not really 😀 Sometimes I just learn the magic spells that work.

Pluto is awesome, but the design is very “principled”, so you either do things the Pluto way or find out how to do things differently.

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 20, 2022, 7:01pm UTC](https://discourse.julialang.org/t/problem-with-module-dependencies-in-pluto/91882/7 "2022-12-20T19:01:08Z")

</div>

I set myself up for that one 😃
