# Why the Project Activated in Jupyter Notebook Does Not Change?

**URL:** <https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 10, 2022, 7:20am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032 "2022-09-10T07:20:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [September 10, 2022, 7:20am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032/1 "2022-09-10T07:20:05Z")

</div>

Hi all,

I know to start a new clean environment / project is by typing this in a terminal:

```julia
julia --project="."

```

So when I do that in different folder and check with:

```julia
julia> ]

pkg> st

```

the packages will be different for different folders.

The bugging / disturbing thing is, I use Jupyter Notebook, and it cannot detect the environment that I call to open IJulia / Jupyter Notebook.

I have installed lots of packages in `LasthrimProjection` folder (intended for Mathematics) thus I create new folder named `FreyaLab` (for Electrical Engineering), but when I start IJulia from FreyaLab and check with `]st` it still detecting or using `LasthrimProjection` environment.

How to change this to `FreyaLab`? So I can install packages related to Electrical Engineering only while using Jupyter Notebook / IJulia.

 ![Capture d’écran_2022-09-10_14-15-10](https://global.discourse-cdn.com/julialang/original/3X/c/8/c81a59318d4625dd91e8ae60e93bc42a6152ac9a.png)

This is a technical question. Thanks all

---

<div class="post-metadata">

**Author:** ![Johan-Gronqvist](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johan-gronqvist/32/29895_2.png) [@Johan-Gronqvist](https://discourse.julialang.org/u/Johan-Gronqvist)\
**Post date:** [September 10, 2022, 7:51am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032/2 "2022-09-10T07:51:22Z")

</div>

> How to change this to `FreyaLab`?

You ensure that you have “a project” in `FreyaLab`, with files `Project.toml` and `Manifest.toml`.

Try, in your notebook, `Pkg.activate(".")`, and then add some packages to the new environment.

After that, any notebook that you open in that folder should use the folder as its environment.

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [September 10, 2022, 8:02am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032/3 "2022-09-10T08:02:30Z")

</div>

You might want to take a look at this guide on `Pkg` which does a great job on explaining the usage of it: [jkrumbiegel.com - Pkg.jl and Julia Environments for Beginners](https://jkrumbiegel.com/pages/2022-08-26-pkg-introduction/)

---

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [September 10, 2022, 8:02am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032/4 "2022-09-10T08:02:34Z")

</div>

To my understanding, the original environment from which you start `notebook()` doesn’t matter, and isn’t used by Jupyter. Jupyter starts its own Julia process, based on the Julia kernel you select.

You can explicitly do

```julia
import Pkg
Pkg.activate("~/FreyaLab")

```

in a cell at the beginning of the notebook to get the notebook to activate that environment.

You can also create a different Jupyter kernel specifically for this project, if this is something you do all the time, but it’s probably overkill if you only need it for this one notebook.

---

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [September 10, 2022, 8:13am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032/5 "2022-09-10T08:13:31Z")

</div>

> [@digital\_carver](#):
>
> You can also create a different Jupyter kernel specifically for this project, if this is something you do all the time

If you do need this, you can do

```julia
using IJulia
installkernel("Julia FreyaLab", "--project=~/FreyaLab")

```

just **once** to add a specific Jupyter kernel for this project. Once you do this, “Julia FreyaLab” will be an additional option to choose in the Jupyter kernels menu.

So anytime after that, you can choose that kernel as the one to run in the Jupyter dropdown menu.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [September 10, 2022, 8:56am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032/6 "2022-09-10T08:56:17Z")

</div>

This works greatly. I can adjust the path to the designated folder.

Given the folder has its own Project.toml and Manifest.toml
