PyPlot.jl icon indicating copy to clipboard operation
PyPlot.jl copied to clipboard

could not find or load the Qt platform plugin "windows" - PyPlot, Julia 0.6.1, windows 10

Open DimitriKolnikov opened this issue 7 years ago • 9 comments
trafficstars

Hello, It seems like there were a lot of related issues in the past, while I had never encountered the problem before: it seems that no backend is available for pyplot any longer. I get this error message: "R6034 An application has made an attempt to load the C runtime library incorrectly...." Then I click 'OK', and it gives: "The application failed to start because it could not find or load the QT platform plugin "windows" in "", Available platform plugins are: minimal, offscreen, windows...."

I tried to change the backend by setting: ENV["MPLBACKEND"]="tk" or "qt4agg" as it was suggested elsewhere, but it did not change anything. I'm using the default python distribution from conda.jl obtained from PyPlot.

I've tried to uninstall and reinstall julia and packages without any success. (Actually I had the problem with julia 0.6.0, then moved to 0.6.1 without it solving the issue.)

It's a recent problem for me, it used to work a couple of weeks ago.

I would be grateful if someone could help.

Best regards,

Dim.

DimitriKolnikov avatar Dec 06 '17 00:12 DimitriKolnikov

(Follow up ...) The strange thing is that when I run directly the python.exe (from .julia\v0.6\Conda\deps\usr), with matplotlib, figures show properly.

Best,

Dim.

DimitriKolnikov avatar Dec 06 '17 08:12 DimitriKolnikov

I've noticed the same thing. It's only an issue with the latest release (last time I checked), so if you Pkg.pin a previous release and then Pkg.build it'll work. I'll try and find time "soon" to bisect to find out where this began to fail.

ChrisRackauckas avatar Dec 09 '17 18:12 ChrisRackauckas

So finally I solved the problem by installing miniconda+matplotlib and rebuiding the PyCall and PyPlot packages in julia: ENV["PYTHON"]="C:\Users\dim\Miniconda3\python.exe" Pkg.build("PyCall") Pkg.build("PyPlot") So I guess there is something wrong in PyPlot.jl regarding the link to the installed python version of the Conda package for windows.

Best,

Dim.

DimitriKolnikov avatar Dec 09 '17 21:12 DimitriKolnikov

With the newest update this now segfaults. But Pkg.pin(v"2.3.1") and rebuilding is a good temporary fix still.

ChrisRackauckas avatar Jan 18 '18 06:01 ChrisRackauckas

See also JuliaPy/PyCall.jl#87 .... the last time this error message appeared, it had to do with a missing "manifest" file in the Julia build.

(I just tried using PyPlot via Jupyter on a clean Windows install, with Conda, and it worked fine after 2c21a76adc380047538717c1df8c7c47d2501f04.)

stevengj avatar Jan 18 '18 15:01 stevengj

Just a word of warning that while Pkg.pin("PyPlot", v"2.3.1") did fix some odd issues for me with Conda, it had the side effect of breaking the console plotting defaults GUI (see https://github.com/JuliaPy/PyPlot.jl/issues/337#issuecomment-372167028). In the attempt to fix that issue, I ended up manually installing anaconda 3 which seems to have resolved the reason for pinning in the first place.

For anyone else wanting to pin to an old version with julia-0.6, I'd suggest Pkg.pin("PyPlot", v"2.3.2") which should be almost the same but with this confusing issue fixed.

c42f avatar Mar 12 '18 01:03 c42f

@c42f, can you do a bisect to see what particular commit caused a problem?

stevengj avatar Mar 12 '18 13:03 stevengj

+1 hitting this issue on AppVeyor (link to logs) with latest PyPlot (not pinned)

cmey avatar May 16 '18 17:05 cmey

I found this work around for AppVeyor: set the environment variable CONDA_JL_VERSION to "3" prior to Pkg.add("Conda"). This has the added benefit of running Python 3, it's about time we switch to Python 3 ;-) Hope this helps others!

cmey avatar May 17 '18 13:05 cmey