JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

Matplotlib Qt backend not working in Windows 10 for default python distribution #467

Closed atbug closed 4 years ago

atbug commented 4 years ago

Since Conda.jl has pinned the miniconda version to 4.5.4 (https://github.com/JuliaPy/Conda.jl/pull/124), I decided to use the default python distribution from python website (python-3.8.1-amd64). However, no matter what I do, I cannot get the Qt backend working.

After looking into the init.jl file in the repository, I found that

julia> using PyCall

julia> PyCall.pyexists("matplotlib.backends.backend_tkagg")
true

julia> PyCall.pyexists("matplotlib.backends.backend_qt5agg")
false

julia> PyCall.pyprogramname
"C:\\Users\\wangc\\AppData\\Local\\Programs\\Python\\Python38\\python.exe"

However, matplotlib.backends.backend_qt5agg can be imported from python:

PS C:\Users\wangc> C:\Users\wangc\AppData\Local\Programs\Python\Python38\python.exe
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.backends.backend_qt5agg # success

Now I am not sure what to do next.

stevengj commented 4 years ago

I think we should just revert JuliaPy/Conda.jl#124 … that was a temporary workaround, but it's been two years, and Python 3.6 these days seems to be broken under Anaconda.

atbug commented 4 years ago

Would it work? I thought it would not due to https://github.com/JuliaPy/Conda.jl/issues/119.

Maybe it doesn't? See https://github.com/JuliaPy/Conda.jl/pull/170#issuecomment-584874054

stevengj commented 4 years ago

Duplicate of #461.