If you're just looking for a simple way to get the equivalent of a Python virtual environment, where all your packages are contained to a project, here's how I'm currently doing it:
Setting up a new environment:
mkdir myproject
cd myproject
julia
]
activate .
# Now it should say (myproject) pkg> as the prompt
add DataFrames
# (for example)
- Now two files will appear in myproject/
- Project.toml - lists all packages installed. Kind of like a requirements.txt file in Python
- Manifest.toml - lists all packages required/available in the project. More intense and complete than Project.toml.
Initializing an environment based on a Project.toml file:
using Pkg
Pkg.activate(".")
Pkg.instantiate()
# this will install the packages listed in Project.toml
(You can also use the ]
method at the REPL)
Note that if you just do Pkg.activate()
(no "."), then it activates the base environment. Usually you won't want to activate the base environment if you're trying to set up an environment specific to a certain project folder.