Need different package versions for work and hobby projects? Give each project its own Julia environment. Its Project.toml records the packages added directly to that environment; Julia creates the file when needed. A package is also an environment, so it has its own Project.toml for identity and dependencies. section 16.1 section 16.2.1
Use Julia’s package mode to manage the active project:
- Run `activate` for the environment you want to change, then `add` packages or `rm` ones you no longer need. section 16.1 section 16.6
- Run `status` to see its added packages. Under `[deps]`, Project.toml associates each package name with a UUID, which distinguishes packages that share a name. section 16.1
- Run `generate` to start a package. Its initial Project.toml contains a name, UUID, authors, and version; activate the package before adding its dependencies. section 16.2.1
shell> cat ToyGeometry/Project.toml name = "ToyGeometry" uuid = "bbcec4ee-a196-4f18-8a9a-486bb424b745" authors = ["Erik Engheim <erik.engheim@mac.com>"] version = "0.1.0" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Inspect a generated package’s Project.toml: package metadata appears above `[deps]`, where Base64 and Dates are listed by UUID. section 16.2.1
Separate work and hobby environments
One environment can add `CairoMakie@0.5.10` for work while another adds a newer CairoMakie for hobby use. Activate the intended environment before adding packages, and use `status` to check what it contains. section 16.1
Do not confuse Project.toml with Manifest.toml: Project.toml shows direct dependencies, while Manifest.toml also records dependencies brought in by those packages. section 16.2.1 section 16.6
