Pluto doesn't find some modules

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 used from within the self-written module are not found anymore.
Module inclusion somehow seems rather broken in Pluto.

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

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.

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

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:

module PolyBound
using Optim

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

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.