I am new to julia and I recently developed an experimental package using these procedures: generate mypackge, entered the directory, followed by activate . and dev ., and add mypackage to be able to do using mypackage and begin calling functions defined in the .jl file. All these were done by poking around and finding fractions of instructions from all over the internet. I honestly don’t know very well what these commands does.
Later I created a git repo on bitbucket, and hosted the package there without registering ( I think, I don’t know what to do to register). I did rm mypackage and verified I can no longer do using mypackage, but I can still do ‘add mypackage’, where pkg tells me that this package is identified with my local directory of mypackage. I next attempted to add the same package from bitbucket by doing add git@<url>:mypackage.jl.git, and got the following error: ERROR: it is invalid to specify multiple packages with the same UUID: <xxxx>
I am not that surprised, but would like to know how to completely remove information about the local package and be able to install from the git repo. Can anyone help me with this?
I am also curious about what dev mypackage does? Why I cannot add the package without first doing ‘dev’?
I’m using windows 10 and Julia 1.4.2.
For your particular case, if the dev’ed version of ’ MyPackagelives in.julia/dev`, maybe it’s still finding that it is there, and there might be a conflict due to the lowercase/camelcase names, but I’m not sure.
You can try to check if that’s what is happening: if the package is in .julia/dev, move it to another place (e.g. outside .julia), and try add again. Let’ see what happens.
Without knowing more about your setup and what exactly you did, it’s hard to say, but when you do ]dev SomePackage, that package gets cloned to your system (usually in ~/.julia/dev) and then the package manager will not touch it, ever. Things like ]free SomePackage and ]rm SomePackage will free/remove the reference from your environment, but will not delete the folder.
I’m not sure why you’re getting the UUID collision, unless you changed the name of the package (in the Project.toml or something) without changing the UUID.
use git to your advantage. If you’ve got a locally dev'd version, use git to update it / change it. Git allows you to have multiple remotes, multiple branches etc.
Double check in your ~/.julia/dev directory that your old version is not still lying around. If it is, and you don’t want to delete it, you can always change the UUID (it’s set in the Project.toml, and you can get a new one with using UUIDs; uuid4()
Oh, yes, that might be also the case. But I don’t like tinkering with the contents of .julia/packages myself. If the add-ed version was removed and not used in any environment anymore, ]gc should do the same in a safe manner, I think.
Thanks for your response. Somehow even though I deved my package, my ~/.julia/ folder does not contain a dev folder, which may be strange. The difference in the upper/lower cases of the repo name and package name (.jl file name and module name) may not really matter, but I attempted the following