4

I am a new in Julia and after adding the Plots package I tried to use Plots and I got this Error message:

julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
ERROR: LoadError: InitError: could not load library "C:\Users\niri.julia\artifacts\7350a6401f1c0d38cc3518193083bc4f83adfe99\bin\avcodec-58.dll"
The specified module could not be found.
Stacktrace:

ERROR: LoadError: Failed to precompile FFMPEG [c87230d0-a227-11e9-1b43-d7ebe4e7570a] to C:\Users\niri.julia\compiled\v1.5\FFMPEG\TGvga_Ik59J.ji.

ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to 

can someone help me to resolve the problem

Ehsan
  • 41
  • 1
  • I think you need to specify what OS you are on, and your julia version – Michael K. Borregaard Sep 07 '20 at 21:32
  • 1
    After you get this error, install the package [`DependencyWalker.jl`](https://github.com/giordano/DependencyWalker.jl) with `]add DependencyWalker` and then run `using DependencyWalker; Library(raw"C:\Users\niri.julia\artifacts\7350a6401f1c0d38cc3518193083bc4f83adfe99\bin\avcodec-58.dll")`. This should tell you what library is missing. – giordano Sep 07 '20 at 21:41
  • 1
    Thank you, I did it and I got this response (✗ C:\Users\niri.julia\artifacts\7350a6401f1c0d38cc3518193083bc4f83adfe99\bin\avcodec-58.dll (NOT FOUND)) – Ehsan Sep 08 '20 at 15:02
  • As pointed out below, the path you showed in the question looks wrong, it should probably be `C:\Users\niri\.julia\artifacts\7350a6401f1c0d38cc3518193083bc4f83adfe99\bin\avcodec-58.dll`? The argument to the `Library` function should be whatever you seen in the terminal – giordano Sep 11 '20 at 23:10

1 Answers1

2

Try to install FFMPEG, rebuild this and Plots as well

using Pkg
pkg"add FFMPEG"
pkg"build FFMPEG"
pkg"build Plots"

There is good chance it will work.

Przemyslaw Szufel
  • 40,002
  • 3
  • 32
  • 62
  • I wouldn't expect that to help. `FFMPEG.jl` doesn't need to be built, my guess is that the operating system doesn't provide all needed libraries, I've seen that on servers – giordano Sep 08 '20 at 09:36
  • Don't artifacts get downloaded during the build step of Julia package life cycle? Of course if there is problem with OS libraries that could be a separate story. – Przemyslaw Szufel Sep 08 '20 at 10:32
  • No, they're installed at `add` time – giordano Sep 08 '20 at 10:39
  • Thank you for your quick response. I did rebuild the FFMPEG and Plots but still I get the same Error. What is the latest version of Julia? mine is 1.5.1 . I was wondering the problem may be resolved in the latest version. I have Windows 10 Enterprise N – Ehsan Sep 08 '20 at 14:56
  • 2
    It works for me on the same config. Your console is showing some strange path: `C:\Users\niri.julia` I guess it should be `C:\Users\niri\.julia`. Perhaps something bad happened to your Julia conf? I would try to delete `C:\Users\niri\.julia`. and reinstall packages. – Przemyslaw Szufel Sep 08 '20 at 15:53