How to remove `ENV` variable or how to `Pkg.add` by setting http(s) proxy to nothing?

On my laptop ENV["HTTP_PROXY"] is usually set to some value. However to install some package I need to not use the HTTP_PROXY temporarily. In R I can just set the HTTP_PROXY to "" then it will work fine, but in Julia 0.7 ENV["HTTP_PROXY"] = "" followed by Pkg.add("DataFrames") gives this error

Error: failed to clone from GitHub - JuliaRegistries/General: The official registry of general Julia packages, error: GitError(Code:ERROR, Class:Net, invalid URL:β€œβ€)

so I think I can solve this by removing ENV["HTTP_PROXY"] or removing it entirely, but I can’t find how do do it? I tried setting it to "", nothing, and missing.

Try

delete!(ENV, "HTTP_PROXY")

Cheers,
Kevin

2 Likes