# Trouble with new local package

**URL:** https://discourse.julialang.org/t/trouble-with-new-local-package/98956
**Category:** New to Julia
**Tags:** question, package
**Created:** [May 16, 2023, 8:58pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956 "2023-05-16T20:58:07Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 16, 2023, 8:58pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/1 "2023-05-16T20:58:07Z")

</div>

I am mostly familiar with Python’s packaging … but I am trying to start a new package for my application. Surely I am getting something wrong.

````julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.9.0 (2023-05-07)
 _/ |\ __'_|_|_|\__'_| |
|__/ |

(@v1.9) pkg> generate Stuff
  Generating project Stuff:
    Stuff/Project.toml
    Stuff/src/Stuff.jl

(@v1.9) pkg> activate Stuff/
  Activating project at `~/Projects/Julia/Stuff`

(Stuff) pkg> status
Project Stuff v0.1.0
Status `~/Projects/Julia/Stuff/Project.toml` (empty project)

(Stuff) pkg> add FFTW
   Resolving package versions...
ERROR: cannot find name corresponding to UUID a63ad114-7e13-5084-954f-fe012c677804 in a registry

(Stuff) pkg> add NetCDF
   Resolving package versions...
ERROR: cannot find name corresponding to UUID a63ad114-7e13-5084-954f-fe012c677804 in a registry

(Stuff) pkg>```
````

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 16, 2023, 9:02pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/2 "2023-05-16T21:02:18Z")

</div>

I deleted `~/.julia` and the `Stuff` folder … restarted Julia, re-generated the `Stuff` project and got the same error:

```julia
(Stuff) pkg> add FFTW
   Resolving package versions...
ERROR: cannot find name corresponding to UUID a63ad114-7e13-5084-954f-fe012c677804 in a registry

```

---

<div class="post-metadata">

### Author: ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)
#### Post date: [May 16, 2023, 9:11pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/3 "2023-05-16T21:11:41Z")

</div>

I don’t know if this is related, but this is the banner I get when I start Julia:

```julia-repl
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.9.0 (2023-05-07)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

```

Yours is missing the “Offical release” note at the bottom.

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 16, 2023, 9:13pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/4 "2023-05-16T21:13:51Z")

</div>

Ah, I `git clone`d the repo, then `git checkout v1.9.0` … if that makes a difference.  
After that I just ran `make -j4` in the directory …

---

<div class="post-metadata">

### Author: ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)
#### Post date: [May 16, 2023, 9:16pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/5 "2023-05-16T21:16:25Z")

</div>

Maybe `pkg> instantiate`? Perhaps you never downloaded the General registry?

Also, PkgTemplates.jl is _highly_ recommended for anything you intend to share with others. It sets up all the CI/documentation skeleton/etc for you, and is part of what contributes to that impression I’ve heard from many Python programmers, “wow, Julia packages are so consistent in their structure!”

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 16, 2023, 9:18pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/6 "2023-05-16T21:18:16Z")

</div>

would `pkg> update` download everything, or must it be `pkg> instantiate`?  
Ok, clearly from the documentation, `instantiate` does the downloading (I didn’t do that). Must I do that in the “root” environment, or just ignore the root environment and only work on sub-environment/package things?

---

<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: [May 16, 2023, 9:27pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/7 "2023-05-16T21:27:16Z")

</div>

Unless you are planning to develop Julia itself, you are taking a hard path. Just download the binary from the Julia site or install `juliaup` and install Julia with it, and things will probably work. (and the use PkgTemplates)

See: [GitHub - JuliaLang/juliaup: Julia installer and version multiplexer](https://github.com/JuliaLang/juliaup)

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 16, 2023, 9:38pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/8 "2023-05-16T21:38:34Z")

</div>

Juliaup sounds neat, sort of like rustup? I’ll check it out.

---

<div class="post-metadata">

### Author: ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)
#### Post date: [May 17, 2023, 11:16am UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/9 "2023-05-17T11:16:22Z")

</div>

It shouldn’t be this hard. Did you just try it? Once the general registry is downloaded for your depot, you should be all set (it no longer depends on the specific environment).

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 17, 2023, 12:03pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/10 "2023-05-17T12:03:57Z")

</div>

I hadn’t issued “pkg instantiate” that did the trick. I should have been more explicit, but I had marked your suggestion to issue the instantiate command as a solution.

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [May 17, 2023, 1:54pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/11 "2023-05-17T13:54:29Z")

</div>

There must be something unusual going on here. The expected result of doing those operations in an empty depot (pointing `JULIA_DEPOT_PATH` to an empty directory is effectively equivalent to deleting `.julia`) is:

```julia
$ cd /tmp
$ mkdir testdepot
$ JULIA_DEPOT_PATH=/tmp/testdepot julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.9.0 (2023-05-07)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(@v1.9) pkg> generate Stuff
  Generating project Stuff:
    Stuff/Project.toml
    Stuff/src/Stuff.jl

(@v1.9) pkg> activate Stuff
  Activating project at `/tmp/Stuff`

(Stuff) pkg> status
  Installing known registries into `/tmp/testdepot`
Project Stuff v0.1.0
Status `/tmp/Stuff/Project.toml` (empty project)

(Stuff) pkg> add FFTW
    Updating registry at `/tmp/testdepot/registries/General.toml`
   Resolving package versions...
   Installed Preferences ───── v1.4.0
   [...]

```

Did you do something else before these operations?

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 17, 2023, 2:11pm UTC](https://discourse.julialang.org/t/trouble-with-new-local-package/98956/12 "2023-05-17T14:11:03Z")

</div>

What you wrote is essentially what I did, but I remember it erroring out. I have some spare time to try it again fresh from the clone. I’ll `make distclean` in the git repo and delete `~/.julia` again and post back.

```bash
# previously (i.e. yesterday)
# git clone https://github.com/JuliaLang/julia.git
# git checkout v1.9.0
rm -rf ~/.julia
cd ~/opt/julia
make clean
make distclean
make -j8
julia

```

And from the Julia session

```julia
]
generate Stuff
activate Stuff
add FFTW

```

and it worked without complaint! 🤷‍♂️  
Conclusion: yesterday was cursed somehow.  
Note: I did _not_ refresh my clone from yesterday, so any changes made remotely would not be the issue either.
