# Package management

**URL:** <https://discourse.julialang.org/t/package-management/68513>\
**Category:** New to Julia\
**Tags:** pkg\
**Created:** [September 21, 2021, 9:09am UTC](https://discourse.julialang.org/t/package-management/68513 "2021-09-21T09:09:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![whatsthecraic](https://avatars.discourse-cdn.com/v4/letter/w/7bcc69/32.png) [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)\
**Post date:** [September 21, 2021, 9:09am UTC](https://discourse.julialang.org/t/package-management/68513/1 "2021-09-21T09:09:46Z")

</div>

Hi there, this is my first question to the community.

I am trying to understand how the package management facility and Project.toml? First, does this file, Project.toml, play the same functionality of virtualenv in Python, to have a different and isolated package environment per each workspace/project?

Second, suppose I have a structure such as the follows:  
/Project1/Project.toml  
/Project1/path/to/something.jl  
/Project1/…  
and I wish to create a separate script, in a different code path that uses the functionalities of /Project1, e.g.  
/Project2/script.jl

How can I load/include from script.jl the file /Project1/path/to/something.jl and all its dependencies? Moreover, how can I add further dependencies in /Project2 without touching /Project1/Project.toml?

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [September 21, 2021, 9:20am UTC](https://discourse.julialang.org/t/package-management/68513/2 "2021-09-21T09:20:19Z")

</div>

Welcome!

> [@whatsthecraic](#):
>
> First, does this file, Project.toml, play the same functionality of virtualenv in Python, to have a different and isolated package environment per each workspace/project?

Yes, that’s roughly correct. You can activate an environment by typing `]activate path/to/env`.

> [@whatsthecraic](#):
>
> How can I load/include from script.jl the file /Project1/path/to/something.jl and all its dependencies? Moreover, how can I add further dependencies in /Project2 without touching /Project1/Project.toml?

If you want to load its dependencies, you can `]activate /Project2` followed by `]add /Project1`. `Pkg` will add the path as a dependency to `Project2`, which will get its own `Project.toml` and `Manifest.toml`.

Note that usually `Project1` has a module called `Project1` at `/Project1/src/Project1.jl`, which you can use by doing `using Project1` after `]add /Project1`. It’s not quite idiomatic to just have environments with files that are `include`d manually - nested directories and namespaces are _not_ related in julia, unlike in python where the namespace structure follows the directory structure.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [September 21, 2021, 9:26am UTC](https://discourse.julialang.org/t/package-management/68513/3 "2021-09-21T09:26:33Z")

</div>

You can also refer to this tutorial on creating packages: [11 - Developing Julia packages - Julia language: a concise tutorial](https://syl1.gitbook.io/julia-language-a-concise-tutorial/language-core/11-developing-julia-packages)

I found much easier to start the package already as a github/gitlab repository rather than having it only locally and modify environmental variables…
