Unable to install IJulia

I have installed the latest version of Julia (1.5.1) on my widows browser successfully and am now trying to create the IJulia notebook functionality. I ran the following commands: Import Pkg which works ok, however when I run the command Pkg.add(“IJulia”) I get the following error:

julia> Pkg.add(“IJulia”)
Installing known registries into C:\Users\nickk\.julia
ERROR: SystemError: opening file “C:\Users\nickk\.julia\registries\General\Registry.toml”: 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(::Base.var"#294#295"{Tuple{}}, ::String; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at .\io.jl:323
[7] open at .\io.jl:323 [inlined]
[8] read at .\io.jl:408 [inlined]
[9] parsefile at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\ext\TOML\src\TOML.jl:50 [inlined]
[10] read_registry(::String; cache::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:1044
[11] read_registry at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:1039 [inlined]
[12] (::Pkg.Types.var"#94#97"{Pkg.Types.Context,String,Pkg.Types.RegistrySpec})(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:1016
[13] mktempdir(::Pkg.Types.var"#94#97"{Pkg.Types.Context,String,Pkg.Types.RegistrySpec}, ::String; prefix::String) at .\file.jl:682
[14] mktempdir at .\file.jl:680 [inlined] (repeats 2 times)
[15] clone_or_cp_registries(::Pkg.Types.Context, ::Array{Pkg.Types.RegistrySpec,1}, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:980
[16] clone_or_cp_registries at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:970 [inlined] (repeats 2 times)
[17] 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:874
[18] clone_default_registries at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:862 [inlined]
[19] 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
[20] 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
[21] 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
[22] 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
[23] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
[24] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
[25] #add#20 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:66 [inlined]
[26] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:66 [inlined]
[27] add(::String; 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:65
[28] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65
[29] top-level scope at REPL[6]:1

Welcome to the community!

ERROR: SystemError: opening file “C:\Users\nickk.julia\registries\General\Registry.toml”: No such file or directory

This is strange. Julia should make this file (copied from the internet) for you.

I found a similar issue and “solution”:

Hm, I deleted the general registry and it seems to be working now.

I’m not sure what’s happening, a temporary internet problem? Or permission problem? I doubt you need the even newer Julia 1.5.2, but could you try again?

Yes so I saw that solution earlier and tried to implement it but it still gives me the same error after deleting the /General/Registry folder. I have disabled my firewall also to try to run this to no avail so it cannot be a permission issue.

I really want to help you but I don’t have Windows, and this shouldn’t be happening.

I do not want new users put off Julia.

Can you do a test for me? The file you’re missing, could you try to put it in manually (what Julia should have done for you). I use Linux and can download it this way, you figure out for Windows and put it in the right place:

$ wget https://raw.githubusercontent.com/JuliaRegistries/General/master/Registry.toml

It might be a workaround, but as I said, this shouldn’t be happening, so I think of it as a step in debugging.

You should be able to install packages by pressing ] and e.g.

(@v1.6) pkg> add Plots

Your way (and older one) should be equivalent. And without the file, this would for sure fail for any other package.

Can you try downloading Julia 1.6 the nightly (and/or Julia 1.5.2)? I still very much doubt this is a bug in Julia 1.5.1 (or newer), as a lot of people have used Julia on Windows…

One more thing I can think of, do you use an older version of Windows? Older than 10 (or 7)?

Windows 7 / Windows Server 2012 users also need to install:

Ok there is good news and bad news now. i was able to import the Registry.toml file and move it to the correct location so that error no longer appears. However now I have a new error after running Pkg.add(“IJulia”):
ERROR: Unsatisfiable requirements detected for package MbedTLS [739be429]:
MbedTLS [739be429] log:
├─MbedTLS [739be429] has no known versions!
└─found to have no compatible versions left with IJulia [7073ff75]
└─IJulia [7073ff75] log:
├─possible versions are: [1.9.0-1.9.3, 1.10.0, 1.11.0-1.11.1, 1.12.0, 1.13.0, 1.14.0-1.14.1, 1.15.0-1.15.2, 1.16.0, 1.17.0, 1.18.0-1.18.1, 1.19.0, 1.20.0-1.20.2, 1.21.0-1.21.3] or uninstalled
└─restricted to versions * by an explicit requirement, leaving only versions [1.9.0-1.9.3, 1.10.0, 1.11.0-1.11.1, 1.12.0, 1.13.0, 1.14.0-1.14.1, 1.15.0-1.15.2, 1.16.0, 1.17.0, 1.18.0-1.18.1, 1.19.0, 1.20.0-1.20.2, 1.21.0-1.21.3]
Stacktrace:
[1] propagate_constraints!(::Pkg.Resolve.Graph, ::Set{Int64}; log_events::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1005
[2] propagate_constraints! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:946 [inlined] (repeats 2 times)
[3] simplify_graph!(::Pkg.Resolve.Graph, ::Set{Int64}; clean_graph::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1460
[4] simplify_graph! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1460 [inlined] (repeats 2 times)
[5] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:375
[6] targeted_resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1114 [inlined]
[7] tiered_resolve(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1100
[8] _resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1120 [inlined]
[9] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1135
[10] 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:189
[11] 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
[12] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
[13] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
[14] #add#20 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:66 [inlined]
[15] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:66 [inlined]
[16] add(::String; 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:65
[17] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65
[18] top-level scope at REPL[2]:1

Something like:

ERROR: Unsatisfiable requirements detected for package MbedTLS [739be429]:
[..]

without the stacktrace can occur sometimes (wouldn’t for brand new install), and it can be somewhat normal. I’m not going to explain now, or how usually to fix it as in this case, as here it’s just a side-effect of a broken install. MbedTLS is part of Julia or should be, so here just a side-effect of trying out my unorthodox fix that didn’t work. I would abandon going down that rabbit hole.

You didn’t answer the other questions, and the “TLS easy_fix” tip is the only idea I can now think of.

Yes sorry I have a windows 10, so I didn’t think the TLS easy_fix tip applied in that case.

Then I would delete the .julia folder. You do not need to download/reinstall Julia to recreated it, just delete it.

If it’s there I believe Julia thinks it’s an ok install from last time. Since it’s not, it may have been a temporary download problem at the server you’re now stuck with.

It worked!! Thank you so so much!!! I was on the verge of giving up but I’m glad I persevered.
With health and happiness,
Nick Kyriacou

1 Like

Good to know, I opened an issue (until fixed people new users should try to delete .julia folder (see nuclear option" warning in next comment, while it not a worry if you just downloaded Julia), this probably never was Windows specific?): https://github.com/JuliaLang/julia/issues/37833

Deleting .julia is a nuclear option, because you’ll have to reinstall all your packages and need to remember to put your startup.jl somewhere safe but I’ve had to do that before to fix IJulia kernel problems.