You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* slight consistency improvements
* mention how to create environments explicitly
* explicit recommendation to use project-specific, local environments
Copy file name to clipboardExpand all lines: writing/index.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -346,12 +346,13 @@ println("hello world")
346
346
347
347
## Environments
348
348
349
-
\tldr{Activate a local environment for each project with `]activate path`. Its details are stored in `Project.toml` and `Manifest.toml`.}
349
+
\tldr{Activate a local environment for each project with `]activate path`. Its details are stored in `path/Project.toml` and `path/Manifest.toml`.}
350
350
351
351
As we have seen, Pkg.jl is the Julia equivalent of `pip` or `conda` for Python.
352
352
It lets you [install packages](https://pkgdocs.julialang.org/v1/managing-packages/) and [manage environments](https://pkgdocs.julialang.org/v1/environments/) (collections of packages with specific versions).
353
353
354
354
You can activate an environment from the Pkg REPL by specifying its path `]activate somepath`.
355
+
You create new environments simply by activating a path that does not contain an environment. The necessary files are created automatically once you `]add` packages.
355
356
Typically, you would do `]activate .` to activate the environment in the current directory.
356
357
Another option is to directly start Julia inside an environment, with the command line option `julia --project=somepath`.
357
358
@@ -360,9 +361,10 @@ Once in an environment, the packages you `]add` will be listed in two files `som
360
361
*`Project.toml` contains general project information (name of the package, unique id, authors) and direct dependencies with version bounds.
361
362
*`Manifest.toml` contains the exact versions of all direct and indirect dependencies
362
363
363
-
If you haven't entered any local project, packages will be installed in the default environment, called `@v1.X` after the active version of Julia (note the `@` before the name).
364
+
If you haven't activated any local project, packages will be installed in the default environment, called `@v1.X` after the active version of Julia (note the `@` before the name).
364
365
Packages installed that way are available no matter which local environment is active, because of "environment [stacking](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks)".
365
-
It is recommended to keep the default environment very light to avoid dependencies conflicts. It should contain only essential development tools.
366
+
It is recommended to keep the default environment very light to avoid dependency conflicts. It should contain only essential development tools.
367
+
Create a separate local environment for each of your projects to contain the dependencies specific to that project.
0 commit comments