Julia 1.0.0 on Windows 10 'using PyPlot can't load library expected at: .julia\\packages\\Conda\\m7vem\\deps\\usr\\python37\

0 down vote favorite

I’m trying to get matplotlib working with Julia 1.0.0.
Installed it but get error when I try to test it by doing this…

ENV["PYTHON"]="c:\\ProgramData\\Anaconda3\\python.exe"
using Pkg
Pkg.add("PyPlot")
using PyPlot

…which gets this error:

ErrorException("error compiling display_error: error compiling findprev: error compiling lookup: error compiling Type: could not load library \"C:\\Users\\ME\\.julia\\packages\\Conda\\m7vem\\deps\\usr\\python37\"\nThe specified module could not be found.

Rather than trying to use your existing Conda, it may be easier just to set Env["PYTHON"]="" and rebuild PyCall (and possibly PyPlot), which should basically download/build everything you need in a Conda just for Julia.

You asked the same question on StackOverflow. And I have just answered it. Why are you duplicating questions?

Sure, and throw away 1.7 GB of disk space as if they were peanuts skins.

You can use your own Python Installation if you are comfortable installing Python packages yourself. Did you install matplotlib? Does

using PyCall
pyimport(“matplotlib”)

work? Is PyCall.python the Python program you want to use?

@pszufe’s solution seems right. I think you probably need to ensure that PyCall and PyPlot were built knowing where your environment was.

As for 1.7 GB of space, I’ve typically found hard drive space to be cheap but debugging/troubleshooting time to be expensive, so I thought I would offer a solution that I was 99% sure would work and would require near 0 troubleshooting time.

Additional, more advanced, notes:

  • an external Python (not Julia in-built) in some scenarios is easier to manage for people coming to Julia for Python
  • the inbuilt Julia Conda package typically takes 3GB of disk space (Windows)
  • you can manipulate with JULIA_DEPOT_PATH and PYTHON environment variables to run Julia with various Python versions (however, I have not tested whether you can run two Python versions at the same time with a single Julia process but it could be possible with the current package manager).

Here is the link to the same question on Stackoverflow:

Another duplicate: Julia 1.0.0 on Windows 10 could not load library expected at: julia\\packages\\Conda\\m7vem\\deps\\usr\\python37\

1 Like

Not on laptops with SSD disks. People too often forget this.

Then you shouldn’t use Windows. The whole design philosophy is to always provide all binary dependencies. That’s why all the Window programs are so huge in size.

1 Like