New Julia User Cannot Add any Packages

Hi, I’ve tried installing Julia on multiple computer systems, and I keep getting error messages whenever I try to add any packages.

Everything seems to go wrong after downloading “MbedTLS”, I tried methods suggested all over the internet to fix that, but nothing works.

The error messages are too lengthy to reproduce here, but contain phrases like, 'Exception setting “SecurityProtocol” ', “invalid enumeration values”, “Exception calling DownloadFile with 2 arguments”, "Unable to automatically install MbedTLS from ", and so on.

Anyone know what’s going on here? (I am using Windows 7 Professional on my old personal Dell Laptop computer; and a newer version of Windows on my Office computer, which runs on a public network. I can’t add packages on either computer.)

julia> using Pkg

julia> Pkg.add("HTTP")
   Updating registry at `C:\Users\<PERSONAL DIRECTORY INFO>\.julia\registries\General`
   Updating git-repo ``
  Resolving package versions...
    Cloning [c8ffd9c3-330d-5841-b78e-0817d7145fa1] MbedTLS_jll from
  Installed MbedTLS_jll ─ v2.16.0+2
   Updating git-repo ``
  Installed HTTP ──────── v0.8.15
   Updating git-repo ``
  Installed MbedTLS ───── v1.0.2
Downloading artifact: MbedTLS
Cannot set property. Property setting is supported only on core types in this language mode.
At line:1 char:1
+ [System.Net.ServicePointManager]::SecurityProtocol =
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertySetterNotSupportedInConstrainedLanguage

New-Object : Cannot create type. Only core types are supported in this language mode.
At line:3 char:15
+ $webclient = (New-Object System.Net.Webclient);
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [New-Object], PSNotSupportedException
    + FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand

The property 'UseDefaultCredentials' cannot be found on this object. Verify that the property exists and can be set.
At line:4 char:1
+ $webclient.UseDefaultCredentials = $true;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

The property 'Credentials' cannot be found on this object. Verify that the property exists and can be set.
At line:5 char:1
+ $webclient.Proxy.Credentials = $webclient.Credentials;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At line:6 char:1
+ $webclient.Headers.Add("user-agent", "Pkg.jl ( ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:7 char:1
+ $webclient.DownloadFile(" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
ERROR: Unable to automatically install 'MbedTLS' from 'C:\Users\<PERSONAL DIRECTORY INFO>'

 [1] error(::String) at .\error.jl:33
 [2] ensure_artifact_installed(::String, ::Dict{String,Any}, ::String; platform::Pkg.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Artifacts.jl:894
 [3] ensure_all_artifacts_installed(::String; platform::Pkg.BinaryPlatforms.Platform, pkg_uuid::Nothing, include_lazy::Bool, verbose::Bool, quiet_download::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Artifacts.jl:958
 [4] download_artifacts(::Pkg.Types.Context, ::Array{String,1}; platform::Pkg.BinaryPlatforms.Windows, verbose::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Operations.jl:616
 [5] download_artifacts(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; platform::Pkg.BinaryPlatforms.Windows, verbose::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Operations.jl:595
 [6] 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.4\Pkg\src\Operations.jl:1091
 [7] 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.4\Pkg\src\API.jl:159
 [8] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:112
 [9] #add#27 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:109 [inlined]
 [10] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:109 [inlined]
 [11] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:107 [inlined]
 [12] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:107 [inlined]
 [13] add(::String; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:106
 [14] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:106
 [15] top-level scope at REPL[3]:1


Did you install MbedTLS_jll on your own? It looks like you might have, which is probably not what you want. Try (in pkg mode)

rm MbedTLS_jll
rm MbedTLS
add MbedTLS

Editing to add that I think this is probably not likely to fix the issue.

No, I did not install MbedTLS on my own.

When I try to add different packages, Julia chokes the same way, but on different subroutines (for example, sometimes it chokes on “OpenSpecFun” instead of MbedTLS).

In any case, I’m confused, are you saying that your suggestion WON’T fix the issue? Should I try it or not? What if I remove (rm) MbedTLS, but then I can’t add it in again??

It could be an issue with powershell; the readme recommends some terminals/editors here: Maybe try another one to see if that helps?

I don’t see how it could be the terminal I’m running it from, I’ve tried running it in command line mode from two completely different computers, plus I tried running it from the Atom-Juno IDE. I get the same errors every time.

I’m not sure what else I’m supposed to get from that website; I didn’t do any of the “Build Julia” steps mentioned on it, I just downloaded the installer onto my Windows PC and let the installation happen automatically.

I posted the entire error message from Julia above, does anyone know from that highly detailed error message what is going on?

Please post Julia version info. Also as much detail about your operating systems as you can. That might help us figure it out. Thanks.

This is the latest version of Julia, just installed, Version 1.4.2 (2020-05-23).

I’ve tried it on my (old) home computer and my (much newer) office computer,
with the exact same problem.

Home: Windows 7 Professional, Service Pack 1, 64-bit OS, Intel Core i7 CPU

Office: Microsoft Windows 10 Enterprise, Version 10.0.18362 Build 18362, x64,
Intel Core i5-8500T, 6 Cores

Proxies, firewalls?

My home computer is sitting on the desk in my house, no proxies or firewalls.

My office computer is on a university network, I don’t know the details. Two completely different computer systems, the same error messages.

I also tried Installing Julia on both computers about 6 months ago, same problems, same error messages.

I’m VPN’ing in to my office computer with Remote Desktop now; 6 months ago I sat at the terminal in my office and typed on it directly. No difference, same problem.

So PetrKryslUCSD, I gave you a lot of information, do you have any suggestions for my problem after all of that?

Does anyone else have any ideas why a new Julia user cannot add or use any packages? Why routines like MbedTLS, OpenSpecFun, and everything else don’t seem to be built properly, even when I follow the error message instructions and try to re-build them, and re-start Julia, but they still don’t work?

From the error message I’d suspect that Julia tries to use Powershell which is in your case running this mode:

and this prevents the download:

I don’t know Powershell, but maybe you can find a way to deactivate this mode for Julia? Google spits out many pages…

You can try to check if the constrained mode is active:

PS C:\Users\User> $ExecutionContext.SessionState.LanguageMode

I get this in VirtualBox and it shows me that it is_not_ activate.

It might be worth rising an issue to at least get a better error message from Julia (e.g. “Windows is configured to use Constrained Language Mode, which prevents downloads of necessary resource”).

1 Like

Hello @CosmoProf We are here to help you. It just might take a little bit of time to figure this out.
I had similar problems two years ago, on a corporate laptio, with the MBedTLS - this was related to the proxy which that company used. I had to ask for a lot of help on here at the time.

We want you to start using Julia. Please stick with it. It will be worth it, honest.

Hi folks, thanks for the suggestions; I eventually did get things working (mostly) by a combination of many things – updating my PowerShell, uninstalling & reinstalling everything, going from the latest release to the long term support release, and removing my Atom-Juno IDE from earlier & re-installing directly from JuliaPro. I’m sure I’ll have more questions, but at least I can add some modules now.