Cannot install SymEngine

Hello,
I’ve encountered some technical issues while trying to install some packages in Julia 1.3.0 in Windows 7:

C:\Windows\system32>julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.3.0 (2019-11-26)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.add("SymEngine")
  Updating registry at `C:\Users\user\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
ERROR: Unable to automatically install 'OpenSpecFun' from 'C:\Users\user\.julia\packages\OpenSpecFun_jll\XrUb6\Artifacts.toml'
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:
\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:810
 [3] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tuple{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_arti
fact_installed), ::String, ::Dict{String,Any}, ::String) at .\none:0
 [4] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Windows, ::Nothing, ::Bool, ::Bool, ::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\
buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:852
 [5] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:0 [inlined]
 [6] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.download_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\bui
ld\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:580
 [7] #download_artifacts at .\none:0 [inlined]
 [8] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\pa
ckage_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
 [9] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPlatforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{P
kg.Types.PackageSpec,1}) at .\none:0
 [10] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\bui
ldbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
 [11] #add at .\none:0 [inlined]
 [12] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, :
:Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
 [13] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
 [14] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [inlined]
 [15] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [inlined]
 [16] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [inlined]
 [17] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [inlined]
 [18] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share
\julia\stdlib\v1.3\Pkg\src\API.jl:66
 [19] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:66
 [20] top-level scope at REPL[2]:1

julia>

Why I am not able to install the package?
Thanks

Looks like an issue with OpenSpecFun and not SymEngine itself. If you want an alternative for symbolic computation, you could use Reduce.jl, for which I made sure the installation works on all operating systems.

Hello, welcome to the Julia community! I believe this may be due to a bug in Julia 1.3.0; please upgrade to Julia 1.3.1 and try again.

EDIT Terribly sorry, I was confused and 1.3.1 has not been released yet. :slight_smile:

Can you please show the output of the following:

pkg> add OpenSpecFun_jll

If that doesn’t work, then please show the output of the following:

julia> using Pkg.BinaryPlatforms; triplet(platform_key_abi())

Hello, Thank you for your reply,
I tried with the first command: using Pkg; Pkg.add("OpenSpecFun_jll") it didn’t work.
Here is the output of the second commad:

julia> using Pkg.BinaryPlatforms; triplet(platform_key_abi())
"x86_64-w64-mingw32-libgfortran4-cxx11"

Thank you for your suggestion. Unfortunately, I am new to julia and I am following a book that uses SymEngine. Regarding Reduce.jl, I will give it a try.
EDIT: I tried to install Reduce.jl:

  • Pkg.add("Reduce"); Pkg.build("Reduce")

I got the following error:

  Building Reduce → `C:\Users\user\.julia\packages\Reduce\4dmwd\deps\build.log`
┌ Error: Error building `Reduce`:
│ ┌ Error: Download failed: curl: (77) error setting certificate verify locations:
│ └ @ Base download.jl:43
│ ERROR: LoadError: failed process: Process(`'C:\Windows\System32\curl.exe' -s -S -g -L -f -o 'C:\Users\user\.julia\packages\Reduce\4dmwd\deps\wincsl.cab' https://ayera.dl.sourceforge.net/project/reduce-algebra/snapshot_2019-09-15/windows/wincsl_5129.cab`, ProcessExited(77)) [77]

 Stacktrace:
│  [1] pipeline_error at .\process.jl:525 [inlined]
│  [2] download_curl(::String, ::String, ::String) at .\download.jl:44
│  [3] download(::String, ::String) at .\download.jl:62
│  [4] top-level scope at C:\Users\user\.julia\packages\Reduce\4dmwd\deps\build.jl:95
│  [5] include at .\boot.jl:328 [inlined]
│  [6] include_relative(::Module, ::String) at .\loading.jl:1105
│  [7] include(::Module, ::String) at .\Base.jl:31
│  [8] include(::String) at .\client.jl:424
│  [9] top-level scope at none:5
│ in expression starting at C:\Users\user\.julia\packages\Reduce\4dmwd\deps\build.jl:30
│ caused by [exception 1]
│ IOError: could not spawn `'C:\Users\user\.julia\packages\Reduce\4dmwd\deps\reduce.exe' --nogui`: no such file or directory (ENOENT)
│ Stacktrace:
│  [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at .\process.jl:99
│  [2] #554 at .\process.jl:112 [inlined]
│  [3] setup_stdios(::Base.var"#554#555"{Cmd}, ::Array{Any,1}) at .\process.jl:196
│  [4] _spawn(::Base.CmdRedirect, ::Array{Any,1}) at .\process.jl:111
│  [5] _spawn(::Base.CmdRedirect, ::Array{Any,1}) at .\process.jl:139 (repeats 2 times)
│  [6] #run#565(::Bool, ::typeof(run), ::Base.CmdRedirect) at .\process.jl:443
│  [7] (::Base.var"#kw##run")(::NamedTuple{(:wait,),Tuple{Bool}}, ::typeof(run), ::Base.CmdRedirect) at .\none:0
│  [8] _spawn(::Cmd, ::Base.DevNull, ::Base.DevNull) at C:\Users\user\.julia\packages\Reduce\4dmwd\deps\svn.jl:23 (repeats 2 times)
│  [9] top-level scope at C:\Users\user\.julia\packages\Reduce\4dmwd\deps\build.jl:88
│  [10] include at .\boot.jl:328 [inlined]
│  [11] include_relative(::Module, ::String) at .\loading.jl:1105
│  [12] include(::Module, ::String) at .\Base.jl:31
│  [13] include(::String) at .\client.jl:424
│  [14] top-level scope at none:5
│ Building Reduce.jl with CSL binaries ...
└ @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\backwards_compatible_isolation.jl:649
false
1 Like

In case, this is (again) a problem of downloading packages via curl you may try this:

Details on the solution are here:
https://curl.haxx.se/docs/manual.html
I can not directly link to the section but you can search for “Config File” on this page.

And here

is some more information about possible locations of _curlrc in windows. I would prefer
%USERPROFILE% as folder to store _curlrc, which typically is C:\Users\YOUR_USER_NAME

Thank you for your suggestions. I followed the instructions provided in the links, but without success.

Hello, which book are you using that describes symengine? I could never find any documentation about it…

If the curl command for installing Reduce doesn’t work, you can manually download it with this link:

https://ayera.dl.sourceforge.net/project/reduce-algebra/snapshot_2019-09-15/windows/wincsl_5129.cab

Then just extract the cab file in Reduce/deps folder manually, and you should be all set now.

1 Like

Just to second OP, I encounter a similar problem when trying to use diff-zoo notebooks, that requires OpenSpecFun… not sure if it’s relevant, though.

I would like to thank you for letting me know about Reduce CAS. It is great!
Could you just give more detailed steps on how to add curl to Reduce folder.

1 Like

Hello, Sorry Actually the book I am talking about used the SymEngine only once in an example. https://www.google.com/search?tbm=bks&q=SymEngine

Here is a manual version of the windows installation script you could try, although I have not tested this manual version myself yet, since I am not using windows right now:

Find the directory below wdir and place the cab file inside, then create a bat script and execute it.

wdir = joinpath(dirname(Base.find_package("Reduce")),"..","deps")
cd(wdir)
# copy cab file in that directory or download it into there, then extract:
open("redextract.bat","w") do f
    write(f,"expand wincsl_5129.cab \"$(wdir)\" -F:*\n")
end
run(`$(wdir)\\redextract.bat`)

Basically, you need to find the directory of Reduce\deps and extract the cab file, which you can do on the windows command line with the expand command, or perhaps you can right click it to extract?

If you have a desktop program that can extract cab files you could also use that, the only thing that matters is that you extract the cab contents into the location of Reduce\deps folder, which you need to locate inside your julia packages folder somewhere.

1 Like