# Terminology confusion: environment vs project

**URL:** https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547
**Category:** General Usage
**Created:** [July 19, 2019, 3:15pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547 "2019-07-19T15:15:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ianfiske](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@ianfiske](https://discourse.julialang.org/u/ianfiske)
#### Post date: [July 19, 2019, 3:15pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547/1 "2019-07-19T15:15:14Z")

</div>

Hi, I’ve been using Julia’s `Pkg` for almost a year with plenty of success. However, I’m giving a presentation at my workplace on Julia workflow and package development next week and realized that I’m pretty confused about some terminology no matter how many times I read

- [9. Glossary · Pkg.jl](https://julialang.github.io/Pkg.jl/v1/glossary/)
- [Code Loading · The Julia Language](https://docs.julialang.org/en/v1/manual/code-loading/#Environments-1)

What is the difference between a _project_ and an _environment_? If I make a new directory, cd into it, and do `activate .`, have I created a project or an environment?

Does a stack of projects make an environment? Or is a stack of environments called a _stacked environment_?

My confusion is furthered a bit since [4. Working with Environments · Pkg.jl](https://julialang.github.io/Pkg.jl/dev/environments/) is title “Working with Environments”, but then proceeds to talk only about projects.

I appreciate any tips to help me with understanding how projects and environments relate/differ.

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [July 19, 2019, 3:48pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547/2 "2019-07-19T15:48:24Z")

</div>

Also refer to [4. Working with Environments · Pkg.jl](https://julialang.github.io/Pkg.jl/v1/environments/)

The way I understand it is projects are useful because they are associated with environments set up just so. Precisely the packages that one needs for the project, with the correct versions of each.

---

<div class="post-metadata">

### Author: ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)
#### Post date: [July 19, 2019, 4:05pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547/3 "2019-07-19T16:05:04Z")

</div>

The way I would put it is that an environment is not necessarily associated with a project, but a project necessarily defines and environment. The environment of your project is described by the `Project.toml` in the project directory, but you can have a `Project.toml` in an environment not associated with a project. Such a `Project.toml` would have a `[deps]` section, but no header (the name `Project.toml` is perhaps confusing). The `Manifest.toml` works similarly: it can be used by your project environment, but it can also be used in an environment not associated with a project.

An environment defines a set of packages as dependencies, optionally with versions down to specific commits. This is true whether or not it’s associated with a project. For project environments, the project will use dependencies defined in its environment.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [July 19, 2019, 5:24pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547/4 "2019-07-19T17:24:30Z")

</div>

An environment is the whole set of things that tell you what `import X` means in different parts of your application. It’s a set of root packages and a dependency graph. (More technically, it is a mapping from top-level names to package UUIDs and a mapping from context UUID/dependency name pairs to dependency UUIDs.)

It’s only confusing because each project does define an environment but there are also other ways environments are defined. For example a directory with a bunch of packages in it also implicitly defines an environment by its file system layout. And the load path defines an environment created by stacking all the individual environments in the `LOAD_PATH` variable.

---

<div class="post-metadata">

### Author: ![ianfiske](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@ianfiske](https://discourse.julialang.org/u/ianfiske)
#### Post date: [July 19, 2019, 5:32pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547/5 "2019-07-19T17:32:08Z")

</div>

Thank you all for the responses! I _think_ I understand. So to recap and try to answer my specific embedded questions above,

> If I make a new directory, cd into it, and do `activate .` , have I created a project or an environment?

Both. This creates a project, which is a type of environment.

> Does a stack of projects make an environment? Or is a stack of environments called a _stacked environment_ ?

We aren’t limited to stacking projects only. We can stack environments (of any type), which creates a stacked environment. Some of the environments that compose this stack might be projects. Some might be other types of environments.

Are these answers true?

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [July 19, 2019, 6:50pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547/6 "2019-07-19T18:50:44Z")

</div>

Yes, you’ve got it.
