Activating a project with modules already in use

package-manager
#1

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: https://julialang.github.io/Pkg.jl/v1/api/#Pkg.activate or the doc page of “working with environments” : https://julialang.github.io/Pkg.jl/v1/environments/ but I didn’t find something there.

0 Likes

#2

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

#3

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

0 Likes

#4

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

0 Likes