New Pkg questions

Thanks for your hard work on Julia to reach this important milestone.
I’m trying to update packages, but find the new package manager to be very confusing to someone who hasn’t been following its evolution.

Could someone create a PSA or you point to a complete tutorial on how to use the new package manageer, in particular how to update existing packages so they work with v0.7 and v1.0?

From googling the very error messages I get, it seems that part of the pain may come from using unregistered packages. However, it’s also possible that I’m missing something very basic.

I tried following the instructions at https://docs.julialang.org/en/latest/stdlib/Pkg/ but those just yield error messages E.g.,

add git@github.com:eford/ABC.jl.git

ERROR: The following package names could not be resolved:

  • Libdl (8f399da3-3557-5675-b5ff-fb832c97cbdb in manifest but not in project)

  • Pkg (44cfe95a-1eb2-52ea-b672-e2afdf69b78f in manifest but not in project)

Please specify by known name=uuid.

Trying using ABC I get messages like

ERROR: LoadError: ArgumentError: Package ABC does not have StatsBase in its dependencies:

  • If you have ABC checked out for development and have

added StatsBase 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 ABC

Typeing Pkg.resolve() gives another even more cryptic error message:

ERROR: The following package names could not be resolved:

  • Libdl (8f399da3-3557-5675-b5ff-fb832c97cbdb in manifest but not in project)

  • Pkg (44cfe95a-1eb2-52ea-b672-e2afdf69b78f in manifest but not in project)

Please specify by known name=uuid.

I have no idea what this error message means, where I’d specify a uuid, how I’d know what value use, or what to do about it. The documention mentions things like manifests and project files, but it seems like maybe they should be automatically generated from my existing package, right? Or maybe I’m supposed to do something? If so, what?

The one thing that’s clear from my googling and looking at old issues, that I’m not the only one who is very confused about how to deal with the new package manager.

Thanks,
Eric

1 Like

An additional Pkg question, can I add a Pkg from within a jupyter notebook? Doesn’t seem like I could enter pkg edit mode in a jupyter notebook.

Yes, just ask before. E.g,
Pkg.add(“CSV”)

Hi Eric,

maybe this is helpful: https://youtu.be/GBi__3nF-rM

regards

Marius

Hi Marius,

Thanks. I did appreciate that video. It was helpful to understand the big picture and to use packages that work.

Unfortunately, my experience is that while some packages “just work”, others give still confusing error messages.

Further, I think that trying to add a package that’s not quite right can might prevent all your other packages from working.

I think I’ve figured out that I had two problems at once that made it difficult to tell when I was getting closer/farther.

One problem was an unregistered package that just provided a C library. I think that the package manager thought it hadn’t built properly, so it was preventing other packages from working right. Now I’ve created empty directories, an empty module, a build.jl script, etc. to convince the package manager that that package is “working”.

My next problem was that in trying to solve the strange error messages about Pkg and Libdl, I had tried adding to them to the REQUIRE file. But that appears to have made the problems worse. For the others who encoutner that problem, it seems that it can be solved by

julia

] dev [giturl]

In a shell, cd into dev/package directory

Remove Pkg and Libdl from the REQUIRE file.

Commit and push

Back in julia:

] update

] build

] precompile

Once you gett it working, commit and push, then you can free the dev version, and readd the now standard version of the package with “] add [giturl]”.

At that point, you have to hope that all the dependancies compile properly. Unfortunately, it seems that my use of JLD and DataArrays is preventing me from going farther in my testing.

I’ll probably get stumped again soon. So I think a tutorial about porting packages would be helpful.

It would also be useful to have someone provide an example workflow of how to maintain code that still works with v0.6.* while trying to gradually get it closer to working with v0.7.

I’ve just created a separate branch for my projects that I’m trying to port. But if it takes a while for other packages they depend on to be ported, then I fear that the changes to work with v0.7 might start to conflict with other development happening.

Cheers,

Eric

2 Likes