Pkg.add doesn't work

I’ve just done a fresh install of Julia (tried multiple versions already, but I need v0.6) and whenever I try Pkg.add, I get the same error:
I’m on a Windows 10.

julia> Pkg.add(“IJulia”)
INFO: Initializing package repository C:\Users\EmJacobs.julia\v0.6
INFO: Cloning METADATA from
ERROR: GitError(Code:ERROR, Class:OS, Failed to rename lockfile to ‘C:/Users/EmJacobs/.julia/v0.6/jl_1E99.tmp/METADATA/.git/objects/pack/pack-d1674f5e7842e87b42948fd78c43b3a79f6ba6a3.idx’: Access is denied.
[1] macro expansion at .\libgit2\error.jl:99 [inlined]
[2] clone(::String, ::String, ::Base.LibGit2.CloneOptions) at .\libgit2\repository.jl:276
[3] #clone#100(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::String, ::String) at .\libgit2\libgit2.jl:562
[4] (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String, ::String) at .<missing>:0
[5] (::Base.Pkg.Dir.##8#10{String,String})() at .\pkg\dir.jl:55
[6] cd(::Base.Pkg.Dir.##8#10{String,String}, ::String) at .\file.jl:59
[7] init(::String, ::String) at .\pkg\dir.jl:53
[8] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at .\pkg\dir.jl:28
[9] add(::String) at .\pkg\pkg.jl:117

This seems to be a windows problem. I am not sure how permissions work on windows, have you tried executing Julia as administrator just to see if it works? On the other hand, if you did this already, and now is executing as a normal user, this may be the source of the problem, if the old files can now only be touched by an administrator.

Yes I’ve tried running Julia as administrator, same error…

Also, I’ve now found a version where this does work: 1.1.1, so it isn’t windows related it seems…
Too bad I need version 0.6.4

Just out of curiosity, why do you need 0.6.4? This version is almost two years old, is unsupported, and you’ll be stuck with ancient, unsupported packages. (For a data point, LightGraphs 0.12 was the last version to work with 0.6; we’re currently prepping a 2.0 version. There’s no way we’d be able to support LG 0.12 for anyone.)

Is there a specific package that you need that only runs on pre-1.0 versions of Julia?

1 Like

How are you installing Julia? I had an issue like that in the past (not on Windows, though) for not using the official binaries. I don’t know if that’s another possible explanation.

I’m using the .exe installer from the downloads page.