IJulia install issue

Hi, I am trying to install IJulia on a Windows 10 system with Julia 1.5.0 version. However , I am facing the following issue. Any help is appreciated. thanks.

(@v1.5) pkg> add IJula
Installing known registries into C:\Users\Nikesh Bansal\.julia
ERROR: SystemError: opening file “C:\Users\NIKESH~1\AppData\Local\Temp\jl_IlrTQQPbOC”: No such file or directory
Stacktrace:
[1] systemerror(::String, ::Int32; extrainfo::Nothing) at .\error.jl:168
[2] #systemerror#48 at .\error.jl:167 [inlined]
[3] systemerror at .\error.jl:167 [inlined]
[4] open(::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) at .\iostream.jl:284
[5] open at .\iostream.jl:273 [inlined]
[6] open(::Pkg.Types.var"#92#93"{Dict{Base.UUID,String},SubString{String}}, ::String; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at .\io.jl:323
[7] open at .\io.jl:323 [inlined]
[8] pkg_server_registry_urls() at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:954
[9] clone_default_registries(::Pkg.Types.Context; only_if_empty::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:868
[10] clone_default_registries at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:862 [inlined]
[11] find_registered!(::Pkg.Types.Context, ::Array{String,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:1239
[12] registry_resolve!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:770
[13] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:176
[14] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:140
[15] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
[16] add(::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67
[17] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:404
[18] do_cmd(::REPL.LineEditREPL, ::String; do_rethrow::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:382
[19] do_cmd at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:377 [inlined]
[20] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\REPLMode\REPLMode.jl:546
[21] #invokelatest#1 at .\essentials.jl:710 [inlined]
[22] invokelatest at .\essentials.jl:709 [inlined]
[23] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\LineEdit.jl:2355
[24] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:1143
[25] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at .\task.jl:356

Can you install any other packages? For example, package Example?

julia> using Pkg

julia> Pkg.add("Example")
  Resolving package versions...
Updating `C:\Users\derek\.julia\environments\v1.5\Project.toml`
  [7876af07] + Example v0.5.3
Updating `C:\Users\derek\.julia\environments\v1.5\Manifest.toml`
  [7876af07] + Example v0.5.3

julia> Example.hello("Hello, World!")
"Hello, Hello, World!"

Hi, thank you for the reply. I was able to install Example package. When I retry to install IJulia, I get the following error now:

ERROR: Unable to automatically install ‘MbedTLS’ from ‘C:\Users\Nikesh Bansal.julia\packages\MbedTLS_jll\txOzO\Artifacts.toml’

Are you sure that path C:\Users\Nikesh Bansal.julia exists? I think it should read C:\Users\Nikesh Bansal\.julia with a \ between your user name and .julia. You should have a directory .julia in your user home directory.

Yes, there is a backslash in my name and .julia. It is somehow missed when I copied the error. I checked on the Julia REPL and C drive.

Did you install Julia recently? Can you delete C:\Users\Nikesh Bansal\.julia and re-install? I sense that you may have a file permission issue.

Yes, I installed it today itself. I tried to re-install, but it shows the same error.

I read on a forum that someone fixed this issue by changing PkgServer but I am not sure if my issue is the same. Here is the link to that issue:

Sounds like the same issue. Did you run the following as @giordano suggested in that thread?

using Pkg
pkg"add https://github.com/giordano/DebugArtifacts.jl.git"

Here’s what that command looks like when I run it:

julia> using Pkg

julia> pkg"add https://github.com/giordano/DebugArtifacts.jl.git"
    Cloning git-repo `https://github.com/giordano/DebugArtifacts.jl.git`
   Updating git-repo `https://github.com/giordano/DebugArtifacts.jl.git`
  Resolving package versions...
Updating `C:\Users\derek\.julia\environments\v1.5\Project.toml`
  [4f05f810] + DebugArtifacts v0.1.0 `https://github.com/giordano/DebugArtifacts.jl.git#master`
Updating `C:\Users\derek\.julia\environments\v1.5\Manifest.toml`
  [4f05f810] + DebugArtifacts v0.1.0 `https://github.com/giordano/DebugArtifacts.jl.git#master`

That issue was different. Github was broken when I had the problem.

Yes, probably a different issue, then. The GitHub registry is working:

(@v1.5) pkg> registry status
Registry Status
 [23338594] General (https://github.com/JuliaRegistries/General.git)

(@v1.5) pkg> registry update
   Updating registry at `C:\Users\derek\.julia\registries\General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`

Furthermore:

julia> using DebugArtifacts
[ Info: Precompiling DebugArtifacts [4f05f810-3073-4646-a23d-fd50056b1323]

julia> debug_artifact("MbedTLS")
[ Info: Platform: Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0", cxxstring_abi=:cxx11))
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

[ Info: Downloading Artifacts.toml to C:\Users\derek\AppData\Local\Temp\jl_DcbnGW\Artifacts.toml...
[ Info: Extracting artifact info for platform x86_64-w64-mingw32-libgfortran5-cxx11...
[ Info: Found meta object with git-tree-sha1 56dea7f5b3394bbf38ca5ffdaeb73fd0cd581983, attempting download...
[ Info: No hash cache found
[ Info: Calculated hash 2d908166e65ba6b3ea6468744872a323896a599e832fed46435ad93874ad250e for file C:\Users\derek\AppData\Local\Temp\jl_MA1TAJ6f2C-download.gz
[ Info: Unpacking C:\Users\derek\AppData\Local\Temp\jl_MA1TAJ6f2C-download.gz into C:\Users\derek\AppData\Local\Temp\jl_DcbnGW\unpacked...

Yes, I tried running the Debug command. Here is the message:

julia> debug_artifact("MbedTLS")
[ Info: Platform: Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0", cxxstring_abi=:cxx11))
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA = C:\ProgramData\julia-1.5.0\bin

[ Info: Downloading Artifacts.toml to C:\Users\NIKESH~1\AppData\Local\Temp\jl_DyTMRd\Artifacts.toml...
ERROR: Could not download https://raw.githubusercontent.com/JuliaBinaryWrappers/MbedTLS_jll.jl/master/Artifacts.toml to C:\Users\NIKESH~1\AppData\Local\Temp\jl_DyTMRd\Artifacts.toml:
Base.IOError("could not spawn `powershell -NoProfile -Command '[System.Net.ServicePointManager]::SecurityProtocol =\n    [System.Net.SecurityProtocolType]::Tls12;\n\$webclient = (New-Object System.Net.Webclient);\n\$webclient.UseDefaultCredentials = \$true;\n\$webclient.Proxy.Credentials = \$webclient.Credentials;\n\$webclient.Headers.Add(\"user-agent\", \"Pkg.jl (https://github.com/JuliaLang/Pkg.jl)\");\n\$webclient.DownloadFile(\"https://raw.githubusercontent.com/JuliaBinaryWrappers/MbedTLS_jll.jl/master/Artifacts.toml\", \"C:\\Users\\NIKESH~1\\AppData\\Local\\Temp\\jl_DyTMRd\\Artifacts.toml\")\n'`: permission denied (EACCES)", -4092)
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] download(::String, ::String; verbose::Bool, auth_header::Nothing) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\PlatformEngines.jl:822
 [3] (::DebugArtifacts.var"#3#4"{String,Pkg.BinaryPlatforms.Windows,String})(::String) at C:\Users\Nikesh Bansal\.julia\packages\DebugArtifacts\VcVh2\src\DebugArtifacts.jl:57
 [4] mktempdir(::DebugArtifacts.var"#3#4"{String,Pkg.BinaryPlatforms.Windows,String}, ::String; prefix::String) at .\file.jl:682
 [5] mktempdir at .\file.jl:680 [inlined] (repeats 2 times)
 [6] debug_artifact(::String, ::Pkg.BinaryPlatforms.Windows) at C:\Users\Nikesh Bansal\.julia\packages\DebugArtifacts\VcVh2\src\DebugArtifacts.jl:53
 [7] debug_artifact(::String) at C:\Users\Nikesh Bansal\.julia\packages\DebugArtifacts\VcVh2\src\DebugArtifacts.jl:43
 [8] top-level scope at REPL[6]:1
caused by [exception 1]
IOError: could not spawn `powershell -NoProfile -Command '[System.Net.ServicePointManager]::SecurityProtocol =
    [System.Net.SecurityProtocolType]::Tls12;
$webclient = (New-Object System.Net.Webclient);
$webclient.UseDefaultCredentials = $true;
$webclient.Proxy.Credentials = $webclient.Credentials;
$webclient.Headers.Add("user-agent", "Pkg.jl (https://github.com/JuliaLang/Pkg.jl)");
$webclient.DownloadFile("https://raw.githubusercontent.com/JuliaBinaryWrappers/MbedTLS_jll.jl/master/Artifacts.toml", "C:\Users\NIKESH~1\AppData\Local\Temp\jl_DyTMRd\Artifacts.toml")
'`: permission denied (EACCES)
Stacktrace:
 [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at .\process.jl:99
 [2] #585 at .\process.jl:112 [inlined]
 [3] setup_stdios(::Base.var"#585#586"{Cmd}, ::Array{Any,1}) at .\process.jl:196
 [4] _spawn at .\process.jl:111 [inlined]
 [5] run(::Cmd, ::Tuple{Base.DevNull,Base.TTY,Base.TTY}; wait::Bool) at .\process.jl:439
 [6] run(::Cmd, ::Tuple{Base.DevNull,Base.TTY,Base.TTY}) at .\process.jl:438
 [7] download(::String, ::String; verbose::Bool, auth_header::Nothing) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\PlatformEngines.jl:817
 [8] (::DebugArtifacts.var"#3#4"{String,Pkg.BinaryPlatforms.Windows,String})(::String) at C:\Users\Nikesh Bansal\.julia\packages\DebugArtifacts\VcVh2\src\DebugArtifacts.jl:57
 [9] mktempdir(::DebugArtifacts.var"#3#4"{String,Pkg.BinaryPlatforms.Windows,String}, ::String; prefix::String) at .\file.jl:682
 [10] mktempdir at .\file.jl:680 [inlined] (repeats 2 times)
 [11] debug_artifact(::String, ::Pkg.BinaryPlatforms.Windows) at C:\Users\Nikesh Bansal\.julia\packages\DebugArtifacts\VcVh2\src\DebugArtifacts.jl:53
 [12] debug_artifact(::String) at C:\Users\Nikesh Bansal\.julia\packages\DebugArtifacts\VcVh2\src\DebugArtifacts.jl:43
 [13] top-level scope at REPL[6]:1

Looks like a file permission problem.

So how do I fix this? I am running Julia as an administrator.

I think that may be the source of the problem. You should initially install Julia as administrator, but subsequently install packages as a non-administrative user. Otherwise, some package operations that you run as a regular user may not have permission to read or write certain files or directories in .julia or temporary files.

Still does not work. I tried to explicitly install MbedTLS package and that works. But now IJulia package install is stuck on the next package ZeroMQ.

Did you delete .julia and the temporary directories and then install the packages as a regular user?

Yes, I have tried that but there is still some error.

If the error is a file permission error, then you will have to track down and delete all of the files or directories that Julia cannot read or write. If you are an administrator, you shouldn’t encounter these errors since an administrator should have permission to read and write files belonging to any user. I think a good general policy is to run as the administrator only when installing software and otherwise as a regular user. Otherwise, this can lead to the administrator creating files in locations, like user home or temporary directories, that users should have permission to read and write, but may not because the administrator owns them.

Thanks @derekmahar. Let me see how to solve this issue.