Error precompiling MATLAB.jl


I am trying to use the MATLAB.jl package on my Mac. The installation seems successful but when I try to use the package I get the following error

julia> using MATLAB
[ Info: Precompiling MATLAB [10e44e05-a98a-55b3-a45b-ba969058deb6]
ERROR: LoadError: MATLAB is not properly installed. Please run"MATLAB") and restart Julia.
[1] error(::String) at ./error.jl:33
[2] top-level scope at /Users/dp1311/.julia/packages/MATLAB/T20Ly/src/MATLAB.jl:40
[3] include(::Function, ::Module, ::String) at ./Base.jl:380
[4] include(::Module, ::String) at ./Base.jl:368
[5] top-level scope at none:2
[6] eval at ./boot.jl:347 [inlined]
[7] eval(::Expr) at ./client.jl:467
[8] top-level scope at ./none:3
in expression starting at /Users/dp1311/.julia/packages/MATLAB/T20Ly/src/MATLAB.jl:37
ERROR: Failed to precompile MATLAB [10e44e05-a98a-55b3-a45b-ba969058deb6] to /Users/dp1311/.julia/compiled/v1.5/MATLAB/6HSOn_F7yJF.ji.
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923

I try to build the package but again I get back an error

Building MATLAB → ~/.julia/packages/MATLAB/T20Ly/deps/build.log
┌ Error: Error building MATLAB:
│ [ Info: Detected MATLAB root folder at "/Applications/"
│ ERROR: LoadError: could not load library "/Applications/"
│ dlopen(/Applications/, 1): image not found
│ Stacktrace:
│ [1] dlopen(::String, ::UInt32; throw_error::Bool) at ``/Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:109
│ [2] dlopen at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
│ [3] dlpath(::String) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:232
│ [4] top-level scope at /Users/dp1311/.julia/packages/MATLAB/T20Ly/deps/build.jl:70
│ [5] include(::String) at ./client.jl:457
│ [6] top-level scope at none:5
│ in expression starting at /Users/dp1311/.julia/packages/MATLAB/T20Ly/deps/build.jl:67
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:949

Did anyone encounter a similar issue? Is there a way to solve the problem?


Are those files it tries to find around, somewhere else maybe? For example /Applications/

I downloaded the most recent version of Matlab and the problem was solved.

1 Like