# Pluto doesn't find some modules

**URL:** https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840
**Category:** Pluto
**Created:** [November 13, 2025, 1:19am UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840 "2025-11-13T01:19:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![trg818](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/trg818/32/219149_2.png) [@trg818](https://discourse.julialang.org/u/trg818)
#### Post date: [November 13, 2025, 1:19am UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840/1 "2025-11-13T01:19:04Z")

</div>

Why does Pluto not seem to find self-written modules I keep in a directory ~/lib/julia when that directory is included via a file `.julia/config/startup.jl` and when they are found by Jupyter notebooks and by the REPL?  
When I force it by pushing it into `LOAD_PATH` in a `begin...end` block, some “official” modules that were installed with the package manager and `use`d from within the self-written module are not found anymore.  
Module inclusion somehow seems rather broken in Pluto.

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [November 13, 2025, 7:22am UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840/2 "2025-11-13T07:22:57Z")

</div>

might be a bit complicated here, but can you maybe try to provide an example? I for example do not fully understand (maybe grammar, maybe not my mother tongue) the sentence “When I force it by” what you are pushing where and what you do afterwards.

Note that by default every Pluto notebook aims to be reproducible and opens its own environment. I think that also resets the load path to be empty (so what you do in the startup is ignored basically).

You could start your notebook with a line

```julia-auto
using Pkg; Pkg.activate(".");

```

to use your own (main/global) environment.

This is on purpose since Pluto notebooks are meant to be reproducible, even when you sent them around by mail. So that is not broken, that is both expected and on purposely chosen behaviour.

---

<div class="post-metadata">

### Author: ![pankgeorg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pankgeorg/32/21549_2.png) [@pankgeorg](https://discourse.julialang.org/u/pankgeorg)
#### Post date: [November 13, 2025, 12:28pm UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840/3 "2025-11-13T12:28:52Z")

</div>

> [@trg818](#):
>
> I keep in a directory ~/lib/julia when that directory is included via a file `.julia/config/startup.jl` and when they are found by Jupyter notebooks and by the REPL?

Pluto does not run your `.julia/config/startup.jl` at all by default. if you want it, you can add a cell that runs it manually. As @kellertuer said, this will make your notebook unreproducible, which is not suggested!

Please share more about your use case if you still have questions

---

<div class="post-metadata">

### Author: ![trg818](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/trg818/32/219149_2.png) [@trg818](https://discourse.julialang.org/u/trg818)
#### Post date: [November 13, 2025, 2:06pm UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840/4 "2025-11-13T14:06:41Z")

</div>

Thanks for the explanation, that wasn’t clear to me and at least explains this behavior. However, the solution with `Pkg.activate` causes all the regular packages not to be found anymore, because the default is overridden, whereas I simply wanted to have my local path in addition to all the rest.  
By “forcing it” I meant `push!(LOAD_PATH, "/Users/myhome/lib/julia")`. Now that local module is also found, but regularly installed modules called from within that local module are not:

```julia-auto
module PolyBound
using Optim

```

`PolyBound` is my local module, `Optim` is a module I have installed the usual way with the package manager.

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [November 13, 2025, 2:22pm UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840/5 "2025-11-13T14:22:16Z")

</div>

I do agree that the setup is a bit involved, but without being able to reproduce the scenario here locally, I am unable to provide further tipps or hints what to look for.

It seems to work in your scripts? Does that “forcing it” work in other circumstances so that you would expect it to work within Pluto as well?

I would suppose it PolyBound is a module (and not a full package) then Optim has to be installed in the environment you are in (without the activation, the Pluto one, with the activation your global one).

I am also unsure what

> Now that local module is also found, but regularly installed modules called from within that local module are not:

means. What is the error you get? What do you expect to work? What are you actually doing?

So overall, sorry to not be able to help, but this seems a bit of a unused scenario to me at least, so I feel it is hard to follow your workflow and expected things.

---

<div class="post-metadata">

### Author: ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)
#### Post date: [November 14, 2025, 3:18am UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840/6 "2025-11-14T03:18:10Z")

</div>

As far as I understand the situation:

- you have some code living in files in `~/lib/julia`. These files just contain `module`s
- you usually `include` these files in `startup.jl`
- this does not work in Pluto.jl

So to me the simple fix is to also `include` them in a cell in Pluto. Just make sure you tell Pluto to load all the libraries beforehand by `using` them. Pluto manages its own environments and starts from a clean slate but automatically adds/install all packages you are `using`. Alternatively you can activate your global environment in Pluto with `import Pkg; Pkg.activate("@v1.xx)` where `xx` is your Julia version.

The more sustainable fix would involve some proper managing of your environments. To me it sounds like you currently just put everything you install into the same default environment - the same that you `include` your libraries into on startup. That’s why it currently works: the dependencies of each of your `module`s just happen to be available in your default, global environment. While that works for now, it is a very brittle setup and will almost surely break in the future and continue to be a constant source of annoyance.

A more sustainable solution is to convert your local `module`s into proper local packages and start using environments for your work. If you are not yet familiar with the concepts, I recommend to give this a quick read:

- [Writing your code](https://modernjuliaworkflows.org/writing/#shared-environments)
- [Writing your code](https://modernjuliaworkflows.org/writing/#local_packages)

The main benefit is that a package knows its dependencies, so you can never run into this issue

> [@trg818](#):
>
> Now that local module is also found, but regularly installed modules called from within that local module are not:

To circle this back to Pluto: once you have some nice enviroment, where you added all your own packages, you can activate that in Pluto via Pkg.  
Alternatively, you can also use Pkg in Pluto to selectively load the packages you really need for the notebook.

---

<div class="post-metadata">

### Author: ![trg818](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/trg818/32/219149_2.png) [@trg818](https://discourse.julialang.org/u/trg818)
#### Post date: [November 14, 2025, 4:27pm UTC](https://discourse.julialang.org/t/pluto-doesnt-find-some-modules/133840/7 "2025-11-14T16:27:57Z")

</div>

Thank you for taking the time for this detailed advice. Yes, what you outlined summarizes essentially the situation, and `include`ing the `startup.jl` is more or less what I ended up doing; the `push` line I mentioned is from my `startup.jl`. It seems that `using Optim` in the main code allows Pluto to make use of it in the module as well. At least it looks like it works now.  
So I guess I’ll eventually reorganize my environments the way you suggested for use with Pluto.
