I am trying to install some packages in Julia. In some cases I get an error and in others I do not. For examples, let’s take the packages Distributions. When I install it, I get the following error message:
(@v1.6) pkg> add Distributions
Updating registry at `C:\Users\alfaroua\.julia\registries\General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Cloning [4c63d2b9-4356-54db-8cca-17b64c39e42c] StatsFuns from https://github.com/JuliaStats/StatsFuns.jl.git
Installed StatsFuns ─────────── v0.9.8
Cloning [34da2185-b29b-5c13-b0c7-acf172513d20] Compat from https://github.com/JuliaLang/Compat.jl.git
Installed Compat ────────────── v3.31.0
Cloning [ffbed154-4ef7-542d-bbb7-c09d3a79fcae] DocStringExtensions from https://github.com/JuliaDocs/DocStringExtensions.jl.git
Installed DocStringExtensions ─ v0.8.5
Cloning [31c24e10-a181-5473-b8eb-7969acd0382f] Distributions from https://github.com/JuliaStats/Distributions.jl.git
Installed Distributions ─────── v0.25.6
Cloning [21216c6a-2e73-6563-6e65-726566657250] Preferences from https://github.com/JuliaPackaging/Preferences.jl.git
ERROR: failed to clone from https://github.com/JuliaPackaging/Preferences.jl.git, error: GitError(Code:ERROR, Class:OS, failed to read data: El servidor devolvió una respuesta no válida o no reconocida
I do not understand how to fix the error. Also, I do not understand why for so packages (e.g Compat) it works and for some others it does not (Preferences.jl).
It also yields an error with JLD
(@v1.6) pkg> add JLD
Resolving package versions...
Cloning [5ced341a-0733-55b8-9ab6-a4889d929147] Lz4_jll from https://github.com/JuliaBinaryWrappers/Lz4_jll.jl.git
ERROR: failed to clone from https://github.com/JuliaBinaryWrappers/Lz4_jll.jl.git, error: GitError(Code:ERROR, Class:OS, failed to read data: El servidor devolvió una respuesta no válida o no reconocida
But I do not get it with other packages such as Statistics, Combinatorics or LinearAlgebra. The output when I install this is
Still I might be wrong. I do not understand pretty well these issues. Certainly, any help works because I have a whole project written in Julia and this issue with the packages has not allowed me to run my code for a week, so I am very worried. I edited the post above with the code I get when I run the ones that work.
Those packages are so called stdlibs, packages which are included with Julia and don’t require a download.
I agree that there’s little obvious system to that. Are you behind a firewall that can interfere with your network traffic? Do you have antivirus software that may overreact to certain files? Does git cloning of the difficult packages work outside of Julia? E.g.
This looks unrelated since it’s git cloning that fails. Here I would rather suggest trying with the package servers, but since that’s the default and has apparently been disabled I assume that has already been tried.
I’m not sure how Julia works with this, I never used Julia on a computer where I hadn’t already installed git, but it might be a good idea to google how to install git on Windows and do so. Can’t swear it will help though.
I tried to do this by following the steps on @StefanKarpinski post and got the following error
(@v1.6) pkg> add "https://github.com/JuliaPackaging/JLLWrappers.jl"
Cloning git-repo `https://github.com/JuliaPackaging/JLLWrappers.jl`
ERROR: failed to clone from https://github.com/JuliaPackaging/JLLWrappers.jl, error: GitError(Code:ERROR, Class:SSL, Your Julia is built with a SSL/TLS engine that libgit2 doesn't know how to configure to use a file or directory of certificate authority roots, but your environment specifies one via the JULIA_SSL_CA_ROOTS_PATH variable. If you believe your system's root certificates are safe to use, you can `export JULIA_SSL_CA_ROOTS_PATH=""` in your environment to use those instead.)