Using Julia on Windows without Administrator privilages

For most of my career, I’ve been working in MATLAB, Fortran, and–more recently Python. I’ve been getting to know (and love) Julia with some personal projects on my home computer for the past month or so.

This week, I decided to start a project at work in Julia, but almost every package I try to build gives me the error:

Warning: On Windows, creating file symlinks requires Administrator privileges

Unfortunately, this would involve putting in a ticket with IT every time I wanted to do something new. And it also means that I could never share my code with anyone else at work since they would also have to go through the same process.

Am I doing something wrong? Is there a workaround for this?

Cool. But the subject line suggests you have a question. Trouble?

No Admin Righs needed.

Sorry, accidentally hit submit before I was finished typing.

How about picking an installation directory?


Notice the bit about administrator privileges. What if you put it in your Documents? Is that any better?

What if you put it in your Documents? Is that any better?

Unfortunately that didn’t work either :confused: . I uninstalled from AppData/Local and reinstalled fresh in Documents and I’m still getting the same messages when I try to add the DifferentialEquations package. It looks like the problem packages are Sundials and SpecialFunctions.

That is interesting. Is your home folder on some sort of a network drive?

Sounds like a binary provider thing. @staticfloat do you know of an issue related to this?

My home folder is on a local drive D:, but not my C: drive. I just tried reinstalling it on the C: drive and hit the same issue.

You mentioned Sundials above. What happens when you do ]build Sundials? The build would leave behind a log file, and there might be some clues in there. For instance I just did

(v1.4) pkg> build Arpack
  Building Arpack → `C:\Users\PetrKrysl\.julia\packages\Arpack\cu5By\deps\build.log`

(v1.4) pkg> 

Note the name of the log file. If an error occurs, it should be mentioned in there somewhere.

It’s unfortunate that the symlinks on Windows are still causing issues. I just got a similar report here: https://github.com/JuliaGeo/GDAL.jl/issues/80. Does setting the environment variable BINARYPROVIDER_COPYDEREF=true help?

When I do ]build Sundials I get in the log file:
┌ Warning: On Windows, creating file symlinks requires Administrator privileges
└ @ Base.Filesystem file.jl:922
┌ Warning: platform_key() is deprecated, use platform_key_abi() from now on
│ caller = ip:0x0
└ @ Core :-1

What do you get?

So it seems, the only proper way is, to set the group policy “Create symbolic links” from “Administrators” to “Users”.
Local Group Policy Editor: Computer configuration → Windows Settings → Security Settings → Local Policies → User Rights Assignment → Create symbolic links

Surely this requires a ticket at your IT department. There may be a central switch for this so they don’t need to go to your and your colleagues machines where your software should also run.

For me the question is now, why I did not had this problem ever? Are there packages which use symbolic links and others not?

Setting BINARYPROVIDER_COPYDEREF=true didn’t get me there either. Thanks for the suggestion though.

When I ]build Sundials, I get:

(v1.2) pkg> build Sundials
  Building Sundials → `D:\Users\jdiegelm\.julia\packages\Sundials\CRi5j\deps\build.log`
┌ Error: Error building `Sundials`:
│ ┌ Warning: On Windows, creating file symlinks requires Administrator privileges
│ └ @ Base.Filesystem file.jl:797
│ ┌ Warning: platform_key() is deprecated, use platform_key_abi() from now on
│ │   caller = ip:0x0
│ └ @ Core :-1
│ [ Info: Downloading https://github.com/JuliaDiffEq/SundialsBuilder/releases/download/sundials-3.1.1.6/Sundials.v1.0.0.x86_64-w64-mingw32.tar.gz to D:\Users\jdiegelm\.julia\packages\Sundials\CRi5j\deps\usr\downloads\Sundials.v1.0.0.x86_64-w64-mingw32.tar.gz...
│ ERROR: LoadError: Could not download https://github.com/JuliaDiffEq/SundialsBuilder/releases/download/sundials-3.1.1.6/Sundials.v1.0.0.x86_64-w64-mingw32.tar.gz to D:\Users\jdiegelm\.julia\packages\Sundials\CRi5j\deps\usr\downloads\Sundials.v1.0.0.x86_64-w64-mingw32.tar.gz:
│ ErrorException("")
│ Stacktrace:
│  [1] error(::String) at .\error.jl:33
│  [2] #download#93(::Bool, ::typeof(BinaryProvider.download), ::String, ::String) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\PlatformEngines.jl:498
│  [3] #download at .\none:0 [inlined]
│  [4] #download_verify#94(::Bool, ::Bool, ::Bool, ::typeof(download_verify), ::String, ::String, ::String) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\PlatformEngines.jl:567
│  [5] #download_verify at .\tuple.jl:0 [inlined]
│  [6] #install#133(::Prefix, ::String, ::Bool, ::Bool, ::Bool, ::typeof(install), ::String, ::String) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\Prefix.jl:314
│  [7] (::getfield(BinaryProvider, Symbol("#kw##install")))(::NamedTuple{(:prefix, :force, :verbose),Tuple{Prefix,Bool,Bool}}, ::typeof(install), ::String, ::String) at .\tuple.jl:0
│  [8] top-level scope at D:\Users\jdiegelm\.julia\packages\Sundials\CRi5j\deps\build.jl:53
│  [9] include at .\boot.jl:328 [inlined]
│  [10] include_relative(::Module, ::String) at .\loading.jl:1094
│  [11] include(::Module, ::String) at .\Base.jl:31
│  [12] include(::String) at .\client.jl:431
│  [13] top-level scope at none:5
│ in expression starting at D:\Users\jdiegelm\.julia\packages\Sundials\CRi5j\deps\build.jl:49
│ caused by [exception 2]
│ 
│ Stacktrace:
│  [1] error() at .\error.jl:42
│  [2] #download#93(::Bool, ::typeof(BinaryProvider.download), ::String, ::String) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\PlatformEngines.jl:492
│  [3] #download at .\none:0 [inlined]
│  [4] #download_verify#94(::Bool, ::Bool, ::Bool, ::typeof(download_verify), ::String, ::String, ::String) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\PlatformEngines.jl:567
│  [5] #download_verify at .\tuple.jl:0 [inlined]
│  [6] #install#133(::Prefix, ::String, ::Bool, ::Bool, ::Bool, ::typeof(install), ::String, ::String) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\Prefix.jl:314
│  [7] (::getfield(BinaryProvider, Symbol("#kw##install")))(::NamedTuple{(:prefix, :force, :verbose),Tuple{Prefix,Bool,Bool}}, ::typeof(install), ::String, ::String) at .\tuple.jl:0
│  [8] top-level scope at D:\Users\jdiegelm\.julia\packages\Sundials\CRi5j\deps\build.jl:53
│  [9] include at .\boot.jl:328 [inlined]
│  [10] include_relative(::Module, ::String) at .\loading.jl:1094
│  [11] include(::Module, ::String) at .\Base.jl:31
│  [12] include(::String) at .\client.jl:431
│  [13] top-level scope at none:5
│ caused by [exception 1]
│ IOError: symlink: operation not permitted (EPERM)
│ Stacktrace:
│  [1] uv_error at .\libuv.jl:90 [inlined]
│  [2] symlink(::String, ::String) at .\file.jl:800
│  [3] probe_symlink_creation(::String) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\PlatformEngines.jl:121
│  [4] #probe_platform_engines!#30(::Bool, ::typeof(BinaryProvider.probe_platform_engines!)) at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\PlatformEngines.jl:175
│  [5] probe_platform_engines! at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\PlatformEngines.jl:169 [inlined]
│  [6] __init__() at D:\Users\jdiegelm\.julia\packages\BinaryProvider\TcAwt\src\BinaryProvider.jl:28
│  [7] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:685
│  [8] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:765
│  [9] _require(::Base.PkgId) at .\loading.jl:990
│  [10] require(::Base.PkgId) at .\loading.jl:911
│  [11] require(::Module, ::Symbol) at .\loading.jl:906
│  [12] include at .\boot.jl:328 [inlined]
│  [13] include_relative(::Module, ::String) at .\loading.jl:1094
│  [14] include(::Module, ::String) at .\Base.jl:31
│  [15] include(::String) at .\client.jl:431
│  [16] top-level scope at none:5
│ Exception setting "SecurityProtocol": "Cannot convert null to type "System.Net.SecurityProtocolType" due to invalid enumeration values. Speci
│ fy one of the following enumeration values and try again. The possible enumeration values are "Ssl3, Tls"."
│ At line:1 char:35
│ + [System.Net.ServicePointManager]:: <<<< SecurityProtocol =
│     + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
│     + FullyQualifiedErrorId : PropertyAssignmentException
│ 
│ Exception calling "DownloadFile" with "2" argument(s): "The underlying connection was closed: An unexpected error occurred on a send."
│ At line:5 char:24
│ + $webclient.DownloadFile <<<< ("https://github.com/JuliaDiffEq/SundialsBuilder/releases/download/sundials-3.1.1.6/Sundials.v1.0.0.x86_64-w64
│ -mingw32.tar.gz", "D:\Users\jdiegelm\.julia\packages\Sundials\CRi5j\deps\usr\downloads\Sundials.v1.0.0.x86_64-w64-mingw32.tar.gz")
│     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
│     + FullyQualifiedErrorId : DotNetMethodException

If I read the error messages above correctly, the error has nothing to do with symlinks:

ERROR: LoadError: Could not download https://github.com/JuliaDiffEq/SundialsBuilder/releases/download/sundials-3.1.1.6/Sundials.v1.0.0.x86_64-w64-mingw32.tar.gz

For some reason the build process cannot download the above file (even though, surprisingly, it actually exists).

2 Likes

That was it! For whatever reason, it’s still having trouble automatically downloading those tar files, but I did it manually and it worked fine.

Slight pain, but at least it’s workable going forward.

Thanks!

1 Like

can you tell me how to setting BINARYPROVIDER_COPYDEREF=true in terminal?

I had the same issue on Windows some time ago. As I remember the solution suggested by @oheil is effective.

It is not a Windows environment variable. Please try this in Julia terminal or startup.jl:

ENV["BINARYPROVIDER_COPYDEREF"]="true"