I’m sorry to ask what may be a stupid question, but how do I get past the error quoted in my subjectline? It tells me to ``Pkg.instantiate()but that yields the same error. So I tried
Pkg.resolve()` and, again, the same error is signalled.
I have removed the files within ~/.julia/registries
and retried, but to no avail.
I suppose I could just start over, creating a new package and then copying my existing code there. But this has happened to me twice, where things work for me (that is, I can use my package in code that’s in another directory, with the using
mechanism) and so I feel that I really just need to figure this out.
I feel as though the phrase You may have a partially installed environment
is a clue. Maybe I was running julia in two separate instances and that lead to a conflict?
I am an old unix guy. I don’t enter applications and stay there. I pop in and out, often with tmux. So it’s entirely likely that I had julia running multiple times. But I’ve done ps aux|grep ulia
to find processes and killed them, afterwards repeating my steps. Again, no luck.
In case it helps, my code is at GitHub - dankelley/OceanAnalysis: Julia code for oceanographic analysis.
Any help would be greatly appreciated. I’ve spent a long time scouring the web for advice.
Sincerely, Dan Kelley. (New to julia, very old to C++, Fortran, R, etc … just very old, I admit.)
What I think happened is that you modified something in your package but did not reinitialized something. If you are using the package in an environment (let’s simply use @v1.11) and you modify your package, you should close the julia session you were using and restart it.
Your package works form me by simply adding the dependencies needed, this is the project file
Project.toml (504 Bytes)
2 Likes
Indeed, NCDatasets
was missing from the Project.toml
.
The relevant part of the error message is
ERROR: LoadError: ArgumentError: Package OceanAnalysis does not have NCDatasets in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
to ensure all packages in the environment are installed.
- Or, if you have OceanAnalysis checked out for development and have
added NCDatasets as a dependency but haven't updated your primary
environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with OceanAnalysis
To add a NCDatasets
, just type ]add NCDatasets
in the REPL.
1 Like
Thanks so much. I copied the Project.toml file you attached to your message, and things work now. I guess if I get problems in the future, I’ll rely on git to let me move back a step to a working setup. I think you must be right about not reinitializing. Perhaps I killed a process in mid-execution or something. Again, thanks!
Thanks very much for the quick and helpful answer. I have things working now. Dan.
1 Like