Resolving package identifier ... as a directory

Hello, i am creating a new package A. After i ativate it, i add another package B i already wrote and published.
I get this:

(A) pkg> add B
[ Info: Resolving package identifier `B` as a directory at `C:\Users\congedom\Documents\Code\julia\B`.

So, instead of adding the package from Julia’s registry it adds it from my PC. I didn’t see this before. How should i specify to add it from the registry?

I locally tested it on Linux and this doesn’t happen for me :confused:

But did you try to free B?
From the manual

That does not work either. When I call free It says that B is expected to ‘to be pinned, tracking a path, or tracking a repository’, which i didn’t. I am using Windows.

I think if you change the current working directory (with cd or by starting julia from a different folder) then it won’t see the local package in the current folder and will instead add it from the registry. (I think you are running into `add Desktop` confused by existing local directory with name of registered package · Issue #1941 · JuliaLang/Pkg.jl · GitHub).

3 Likes

Indeed adding the package as Pkg.add("B"), as suggested in the issue, works fine (i was adding by ]add B and this runs into the issue). Thanks!

Ah, that’s an even better fix!