Package names could not be resolved: * MyPkg (91bcb2...e67b in manifest but not in project)

Minimal Example
I’m running julia1.3. I have a minimal Package called MyPkg. It contains a Project.toml file and a src folder with a MyPkg.jl file that is empty.

.
|-- Project.toml
`-- src
    `-- MyPkg.jl

The Project.toml looks like this:

name = "MyPkg"
uuid = "91bcb29e-4cb6-43fb-982d-23ba0ee3e67b"
authors = ["Author"]
version = "0.1.0"

I want to use this package for the project I’m working on. So, I have a folder for my project with the following structure:

.
|-- Manifest.toml
|-- Project.toml
|-- README.md
`-- runs
    `-- full-spectrum
        `-- main.jl

Now, I want to add MyPkg to the environment for my project. So, I have:

(MyProject) pkg> add path/to/MyPkg

Note that I get the same error if I try adding the package by using the url to the git repo.

This gives me the following Project.toml:

name = "MyProject"
uuid = "3e7b5bd9-e9fd-4c85-9fed-c9a4b702d0db"
authors = ["Author"]
version = "0.1.0"

[deps]
MyPkg = "91bcb29e-4cb6-43fb-982d-23ba0ee3e67b"

and Mainfest.toml:

# This file is machine-generated - editing it directly is not advised

[[MyPkg]]
git-tree-sha1 = "3282257cf25a6115791bbebede1bf60bf968e396"
repo-rev = "master"
repo-url = "../MyPkg"
uuid = "91bcb29e-4cb6-43fb-982d-23ba0ee3e67b"
version = "0.1.0"

Finally, I try to dev the package:

(MyProject) pkg> dev MyPkg
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: The following package names could not be resolved:
 * MyPkg (91bcb29e-4cb6-43fb-982d-23ba0ee3e67b in manifest but not in project)
Please specify by known `name=uuid`.

Question
How does that error make sense? I want to be able to make changes to MyPkg without commiting to a git repo and use those changes in MyProject. I thought dev was the way to do that.

1 Like

Hmmm, I can be wrong there, but you often do not add and dev the same package, you just do one of them. If you want to have your package as a dependency inside your project, and keep editing the package, activate the environment for your project and dev your package there (using the path, as you did with add), but do not add it.

Ahhh, yes you’re absolutely right. Thank you!

1 Like