Guru's Verification engine ensures consistency, confidence, and trust in the knowledge your organization shares. Learn more.

Julia | How to add a package to a specific project

As usual, when creating project codebases, it's recommended to maintain a controlled environment for the dependencies of the project so that collaborators can reliably reproduce the same results from the codebase. This usually means activating specific environments for package managers to use.

To do so in Julia:

  1. Change working directory to the project.

  2. Start the Julia REPL by typing julia into the command prompt.

  3. Press the ] key; this should change mode to the package manager, with a prompt that looks like this:
    (@v1.6) pkg>

  4. Activate the current working directory as the environment (the period indicates the current directory):
    (@v1.6) pkg> activate .
    Activating environment at `your/project/path/Project.toml`

As long as the environment is active, any time you add a package, the package dependency will be added to the current project.

Resources:

You must have Author or Collection Owner permission to create Guru Cards. Contact your team's Guru admins to use this template.