ERROR: could not load library "C:...\libsvm.dll"

Hello, i have the following error at execution time when i run the example given in the readme of the LIBSVM.jl package, as soon as i call a function from that package. The thing is, I get this error on one of my machines, but not on another one, while both machines run under Windows 10.

I have verified that the libsvm.dll file exists and that it is in the right place.
Also, i have completely uninstalled julia (v1.3) and atom and reinstalled all packages from scratch, but the error still appears. Any idea where this may come from?

ERROR: could not load library "C:\Users\congedom-admin\.julia\packages\LIBSVM\jzCVO\src\../deps\libsvm.dll"

Stacktrace:
 [1] #dlopen#3(::Bool, ::typeof(Libdl.dlopen), ::String, ::UInt32) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Libdl\src\Libdl.jl:109
 [2] dlopen at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Libdl\src\Libdl.jl:109 [inlined] (repeats 2 times)
 [3] get_libsvm() at C:\Users\congedom-admin\.julia\packages\LIBSVM\jzCVO\src\LIBSVM.jl:167
 [4] svm_set_num_threads() at C:\Users\congedom-admin\.julia\packages\LIBSVM\jzCVO\src\LIBSVM.jl:185    
 [5] set_num_threads(::Int64) at C:\Users\congedom-admin\.julia\packages\LIBSVM\jzCVO\src\LIBSVM.jl:299 
 [6] #svmtrain#3(::Type, ::LIBSVM.Kernel.KERNEL, ::Int64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Bool, ::Bool, ::Nothing, ::Float64, ::Bool, ::Int64, ::typeof(svmtrain), ::Array{Float64,2}, ::CategoricalArray{String,1,UInt8,String,CategoricalString{UInt8},Union{}}) at C:\Users\congedom-admin\.julia\packages\LIBSVM\jzCVO\src\LIBSVM.jl:349
 [7] svmtrain(::Array{Float64,2}, ::CategoricalArray{String,1,UInt8,String,CategoricalString{UInt8},Union{}}) at C:\Users\congedom-admin\.julia\packages\LIBSVM\jzCVO\src\LIBSVM.jl:347
 [8] top-level scope at none:0

I have seen this problem in the past and for me it was because there is a dependency in libsvm.dll on VCOMP140.DLL which is part of VC++, so it was fixed by installing a VC++ redist package:

Not sure if that’s the case here, but may explain why it works on one computer and not another

Sooooo nice. It worked for me too.
Thanks!

Hello,

I am encountering a very similar error. I am using Julia 1.7.3 on Windows 10 OS. I have installed the VC++ package as suggested.

The problem is, when I call SVM() as an empty function, it creates a SVM model. But, when it is called with fit(SVM(), train_data, label), it gives the following error.

What could be the reason??

Fitting SVM model…
ERROR: could not load library “C:\Users\altindif.julia\packages\LIBSVM\5Z99T\src../deps\libsvm.dll”
Le module spécifié est introuvable.
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl .\libdl.jl:117
[2] dlopen (repeats 2 times)
@ .\libdl.jl:117 [inlined]
[3] get_libsvm()
@ LIBSVM C:\Users\altindif.julia\packages\LIBSVM\5Z99T\src\LIBSVM.jl:167
[4] svm_set_num_threads()
@ LIBSVM C:\Users\altindif.julia\packages\LIBSVM\5Z99T\src\LIBSVM.jl:185
[5] set_num_threads(nt::Int64)
@ LIBSVM C:\Users\altindif.julia\packages\LIBSVM\5Z99T\src\LIBSVM.jl:299
[6] svmtrain(X::Matrix{Float64}, y::Vector{Int64}; svmtype::Type, kernel::LIBSVM.Kernel.KERNEL, degree::Int64, gamma::Float64, coef0::Float64, cost::Float64, nu::Float64, epsilon::Float64, tolerance::Float64, shrinking::Bool, probability::Bool, weights::Nothing, cachesize::Float64, verbose::Bool, nt::Int64)
@ LIBSVM C:\Users\altindif.julia\packages\LIBSVM\5Z99T\src\LIBSVM.jl:349