# On writing modules using functions from other packages

**URL:** <https://discourse.julialang.org/t/on-writing-modules-using-functions-from-other-packages/72602>\
**Category:** General Usage\
**Tags:** package, module\
**Created:** [December 5, 2021, 5:33am UTC](https://discourse.julialang.org/t/on-writing-modules-using-functions-from-other-packages/72602 "2021-12-05T05:33:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [December 5, 2021, 10:37am UTC](https://discourse.julialang.org/t/on-writing-modules-using-functions-from-other-packages/72602/3 "2021-12-05T10:37:16Z")

</div>

If you add the dependencies (Images, here) to the main environment, that should work.

This is a reasonable solution while the number of packages is not too great (I have Plots and a bunch of other packages installed in the main environment, exactly for wanting to use them eventually in other places).

Other alternatives can be to have _one_ package with your inhouse functions.

Or, depending on what you are doing, you can create an environment just for running your module, using something like:

```julia
import Pkg
Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
Pkg.activate(temp=true)
Pkg.add(name="Images")
push!(LOAD_PATH, "/home/bruno/Documents/juliautils/mymodules")
using MyModule

```

The second line avoids the registry to be updated and thus the subsequent “adding” of the package `Images` is fast. This is practical, actually, but it prints a bunch of stuff to the screen ( ~~maybe~~ [there is an option to `Pkg` to work silently](https://discourse.julialang.org/t/quiet-pkg-installation-precompilation/53796/2)).

---

_[View the full topic](https://discourse.julialang.org/t/on-writing-modules-using-functions-from-other-packages/72602)._
