Cannot add StatsBase package, getting GitError

I am using Julia 1.0. I am trying to add this package but I get this error. I have tried to update package module but that doesn’t help
ERROR: GitError(Code:EMERGECONFLICT, Class:Checkout, 4479 conflicts prevent checkout)

(edited)

Looks like you have dev-ed StatsBase (i.e. when you are in package mode, your did dev StatsBase. Posting the listing of status, again executed in the package mode, will show this. Package-mode you enter by hitting ]). Also by the sounds of it, you don’t want to dev it. Try free StatsBase. Otherwise, please report the output of status.

PS: welcome to julia-discourse! Have a look at Please read: make it easier to help you

I think this is some issue with the registry. If you delete .julia/registries/General it should re-download a new version that hopefully should fix the problem.

I tried to add the package via REPL but I failed. The code , erroe and status is mentioned below

(v1.0) pkg> add"StatsBase"
Updating registry at C:\Users\Shuzair\.juliapro\JuliaPro_v1.0.5-2\registries\JuliaPro
Updating git-repo https://pkg.juliacomputing.com//registry/JuliaPro
ERROR: GitError(Code:EMERGECONFLICT, Class:Checkout, 4479 conflicts prevent checkout)
Stacktrace:
[1] macro expansion at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\LibGit2\src\error.jl:101 [inlined]
[2] #checkout_tree#46(::LibGit2.CheckoutOptions, ::Function, ::LibGit2.GitRepo, ::LibGit2.GitCommit) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\LibGit2\src\repository.jl:358
[3] checkout_tree at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\LibGit2\src\repository.jl:356 [inlined]
[4] ffmerge!(::LibGit2.GitRepo, ::LibGit2.GitAnnotated) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\LibGit2\src\merge.jl:107
[5] merge!#89(::LibGit2.MergeOptions, ::LibGit2.CheckoutOptions, ::Function, ::LibGit2.GitRepo, ::Array{LibGit2.GitAnnotated,1}, ::Bool) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\LibGit2\src\merge.jl:234
[6] merge! at .\none:0 [inlined]
[7] merge!#140(::String, ::String, ::Bool, ::LibGit2.MergeOptions, ::LibGit2.CheckoutOptions, ::Function, ::LibGit2.GitRepo) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\LibGit2\src\LibGit2.jl:784
[8] merge! at .\none:0 [inlined]
[9] update_registries(::Pkg.Types.Context, ::Array{Pkg.Types.RegistrySpec,1}) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\Pkg\src\Types.jl:1254
[10] update_registries at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\Pkg\src\Types.jl:1219 [inlined]
[11] #handle_repos_add!#61(::Bool, ::Nothing, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\Pkg\src\Types.jl:719
[12] #handle_repos_add! at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\Pkg\src\API.jl:0 [inlined]
[13] #add_or_develop#17(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\Pkg\src\API.jl:47
[14] (::getfield(Pkg.API, Symbol(“#kw##add_or_develop”)))(::NamedTuple{(:mode,),Tuple{Symbol}}, ::typeof(Pkg.API.add_or_develop), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at .\none:0
[15] do_add!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\Pkg\src\REPLMode.jl:672
[16] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Any, ::Aia\stdlib\v1.0\REPL\src\REPL.jl:1034
[26] run_repl(::REPL.AbstractREPL, ::Any) at C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\stdlib\v1.0\REPL\src\REPL.jl:191
[27] (::getfield(Base, Symbol(“##720#722”)){Bool,Bool,Bool,Bool})(::Module) at .\client.jl:355
[28] #invokelatest#1 at .\essentials.jl:697 [inlined]
[29] invokelatest at .\essentials.jl:696 [inlined]
[31] exec_options(::Base.JLOptions) at .\client.jl:277
[32] _start() at .\client.jl:425

I tried this but it did’t resolved the issue

I tried to add another package “Stats” but I am facing the same problem again

What happens if you rename your C:\Users\Shuzair\.juliapro to, say, C:\Users\Shuzair\.juliaproBAK. And try again?

Thankyou for helping and taking out time for this problem. I somehow resolved the issue

I deleted Julia via regedit then everything and every folder related to Julia. I then reinstalled it and now I am able to add any package I want with no issue.

Note: deleting it via control panel/ uninstall program doesn’t resolve the issue, I tried it

1 Like