# Copying packages to ~/.julia, but they aren't found

**URL:** <https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249>\
**Category:** General Usage\
**Created:** [October 12, 2018, 7:04pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249 "2018-10-12T19:04:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![natemcintosh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/natemcintosh/32/9021_2.png) [@natemcintosh](https://discourse.julialang.org/u/natemcintosh)\
**Post date:** [October 12, 2018, 7:04pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/1 "2018-10-12T19:04:21Z")

</div>

I do a lot of work on an offline machine, and I’m trying to set up Julia on it. I already have Julia installed and working on that offline machine.

As a first attempt at bringing in packages, I’ve copied and pasted all the packges in my ~/.julia/packages folder, from my online machine (macOS) to my offline machine (linux).

When attempting to use those packages, e.g. `using DifferentialEquations` I get that they aren’t found.

Am I going about this completely the wrong way?

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [October 12, 2018, 7:32pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/2 "2018-10-12T19:32:39Z")

</div>

The new package manager uses a manifest file to manage all packages. You could manually edit the `.julia/environments/v1.0/Manifest.toml` and register them that way (then copy it into `dev` instead of `packages`. Or you could use the `generate` command to automatically handle the creation of a new package, and then paste your files into the `dev` directory. There’s probably some other ways you can go about it too, but someone who is more knowledgable about the new package manager would have to explain.

If you already have the global manifest file from another installation of Julia, copy it along with the `packages` directory.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 12, 2018, 8:14pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/3 "2018-10-12T20:14:46Z")

</div>

> [@chakravala](#):
>
> You could manually edit the `.julia/environments/v1.0/Manifest.toml` and register them that way (then copy it into `dev` instead of `packages` .

Don’t do this.

> [@natemcintosh](#):
>
> Am I going about this completely the wrong way?

Kinda. What is inside `~/.julia/packages` is not the same as what is installed and putting something there does not make it available to `using`. What is available to `using` is governed by the `Project.toml` file. The default one is located under `~/.julia/environments/v1.0/Project.toml` and is accompanied with `~/.julia/environments/v1.0/Manifest.toml`. You can try to copy your `~/.julia/packages` folder together with the `Project.toml` and `Manifest.toml` files to the other computer. In theory this should work for pure Julia packages. It will fail for packages with binary dependencies though, since you copy between two OS.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [October 12, 2018, 10:38pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/4 "2018-10-12T22:38:49Z")

</div>

> [@fredrikekre](#):
>
> Don’t do this.

The global Manifest and Project files are simple enough that you can hack them manually, if you have the spirit of adventure.

For example, if you are only copying a subset of packages over, you can splice the portions of the Manifest specific to those packages.

Theoretically, you could write an import/export tool that automatically picks out the relevant sections of the global manifest for a list of pkg.

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [October 12, 2018, 10:57pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/5 "2018-10-12T22:57:25Z")

</div>

I think the point is just that there is a cleaner way to get the job done.

---

<div class="post-metadata">

**Author:** ![natemcintosh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/natemcintosh/32/9021_2.png) [@natemcintosh](https://discourse.julialang.org/u/natemcintosh)\
**Post date:** [October 15, 2018, 8:52pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/6 "2018-10-15T20:52:17Z")

</div>

> [@fredrikekre](#):
>
> It will fail for packages with binary dependencies though, since you copy between two OS.

If it turns out I need some of these packages, could I theoretically use an online Linux machine to download the desired packages, and then copy to the offline Linux machine?

Would the two versions of Linux need to be exactly the same?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 15, 2018, 9:23pm UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/7 "2018-10-15T21:23:50Z")

</div>

> [@natemcintosh](#):
>
> If it turns out I need some of these packages, could I theoretically use an online Linux machine to download the desired packages, and then copy to the offline Linux machine?
> 
> Would the two versions of Linux need to be exactly the same?

Try it! I don’t know, will probably be different depending on the package and its dependencies.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 16, 2018, 6:33am UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/8 "2018-10-16T06:33:46Z")

</div>

> [@natemcintosh](#):
>
> Would the two versions of Linux need to be exactly the same?

If that is a concern (I don’t know), you can always use something like a Docker image to replicate the exact same environment. Or even have a Dockerfile download and install everything, then just copy the resulting image to the machine w/o net access.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [October 17, 2018, 12:56am UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/9 "2018-10-17T00:56:47Z")

</div>

The OS would not have to be exactly the same, but you would need to have the appropriate version of dependencies for BLAS, etc.

---

<div class="post-metadata">

**Author:** ![Timothy](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@Timothy](https://discourse.julialang.org/u/Timothy)\
**Post date:** [April 19, 2022, 5:22am UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249/10 "2022-04-19T05:22:59Z")

</div>

If you want to copy packages from a machine with internet access to an offline machine (without internet access), you need to copy the entire `.julia` directory (and not just the ~/.julia/packages folder).

A method that has worked for me:

To get Julia working on a computer without internet access:

1. Install desired packages onto a computer with internet access.
2. Copy entire `.julia` directory and transfer onto the computer without internet access.

I have tested this for the online and offline machine running Windows10. I assume you could do the same with other operating systems as long as the operating system on both computers is the same.
