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

**URL:** <https://discourse.julialang.org/t/error-could-not-load-library-c-libsvm-dll/32056>\
**Category:** New to Julia\
**Created:** [December 9, 2019, 5:00pm UTC](https://discourse.julialang.org/t/error-could-not-load-library-c-libsvm-dll/32056 "2019-12-09T17:00:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [December 9, 2019, 5:00pm UTC](https://discourse.julialang.org/t/error-could-not-load-library-c-libsvm-dll/32056/1 "2019-12-09T17:00:55Z")

</div>

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?

```julia
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

```

---

<div class="post-metadata">

**Author:** ![JackDunnNZ](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jackdunnnz/32/3749_2.png) [@JackDunnNZ](https://discourse.julialang.org/u/JackDunnNZ)\
**Post date:** [December 9, 2019, 5:43pm UTC](https://discourse.julialang.org/t/error-could-not-load-library-c-libsvm-dll/32056/2 "2019-12-09T17:43:20Z")

</div>

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:

> **[Latest supported Visual C++ Redistributable downloads](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170)**
>
> This article lists the download links for the latest versions of Visual C++ Redistributable packages.

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

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [December 10, 2019, 12:17pm UTC](https://discourse.julialang.org/t/error-could-not-load-library-c-libsvm-dll/32056/3 "2019-12-10T12:17:16Z")

</div>

Sooooo nice. It worked for me too.  
Thanks!

---

<div class="post-metadata">

**Author:** ![fatihaltindis](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@fatihaltindis](https://discourse.julialang.org/u/fatihaltindis)\
**Post date:** [October 10, 2022, 2:32pm UTC](https://discourse.julialang.org/t/error-could-not-load-library-c-libsvm-dll/32056/4 "2022-10-10T14:32:43Z")

</div>

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
