Activating a project with modules already in use

Hello, I have a question. What if I do:

using Package1, Pkg
Pkg.activate("path")
using Package1

What happens if the project I activated in path has also a version of Package1 added and this version is different from the version of the global environment?

If this is answered in some documentation please share it here. I expected the answer to be connected with the docstring of activate: 12. API Reference · Pkg.jl or the doc page of “working with environments” : 4. Working with Environments · Pkg.jl but I didn’t find something there.

Nothing happens. Only the version of a package that is first loaded in any given Julia session will ever be loaded in that session.

1 Like

Okay, I see. Is there a way to “replace” modules then?

Sure, you can just evaluated them again (e.g. by re-includeing the file that defines them).