Introduction to the Package Manager
This is only a small glimpse into the Julia package manager. For an in depth intro see Pkg.jl and Julia Environments for Beginners.
0.1 Essentials
add PackageName- Install a packagerm PackageName- Remove a packageuporupdate- Update all packagesresolve- Determine versions of all packages specified in Project.toml and Manifest.toml`instantiate- Install all packages from Project.tomlstorstatus- Show installed packagesactivate .- Activate environment in current directory?- Get help
1 REPL package manager mode
There are two ways to interact with the package manager. Either programmatically by loading it in via using Pkg or by switching to the pkg mode in the REPL. Here we will use the REPL mode. To switch to the pkg mode use the closing square bracket.
]This will switch the prompt of your REPL and now you can do package management tasks.
Note
From now on we will assume you are in the pkg REPL mode
- get some help
? # help1.1 Activating your environment
- Activate your
activate .
# You can use any path that is on your computer- See what is installed
st # status- Download all installed packages
instantiate1.2 Package handling
- Add a package
add Example- Remove a package
rm Example- Update packages
up
up PackageName1.2.1 Further reading
- Pkg.jl documentation
- Pkg.jl and Julia Environments for Beginners
- Modern Julia workflows on environments
For a more in depth introduction and more tips and tricks see the REPL Mastery workshop from JuliaCon 2022.