Merge pull request #651 from huckl3b3rry87/pull-request/43a21364

Pull request/43a21364
This commit is contained in:
Tom Breloff 2017-01-19 22:02:55 -05:00 committed by GitHub
commit 0421fe9a82

View File

@ -55,6 +55,10 @@ function add_backend_string(::PyPlotBackend)
withenv("PYTHON" => "") do withenv("PYTHON" => "") do
Pkg.build("PyPlot") Pkg.build("PyPlot")
end end
import Conda
Conda.add("qt=4.8.5")
# now restart julia!
""" """
end end
@ -81,7 +85,17 @@ function _initialize_backend(::PyPlotBackend)
const pycollections = PyPlot.pywrap(PyPlot.pyimport("matplotlib.collections")) const pycollections = PyPlot.pywrap(PyPlot.pyimport("matplotlib.collections"))
const pyart3d = PyPlot.pywrap(PyPlot.pyimport("mpl_toolkits.mplot3d.art3d")) const pyart3d = PyPlot.pywrap(PyPlot.pyimport("mpl_toolkits.mplot3d.art3d"))
end end
if is_linux()
@eval begin
# avoid Conda update that causes Segfault with qt >=4.8.6 on Ubuntu https://github.com/JuliaPy/PyPlot.jl/issues/234
import Conda
kw = Conda._installed_packages_dict()
if (!haskey(kw,"qt") || (qt_version=get(kw,"qt",0)[1]!=v"4.8.5"))
print("\n If the code has a Segmentation fault error switch to qt v4.8.5 by pasting the following code into julia: \n \n")
add_backend_string(backend())
end
end
end
# we don't want every command to update the figure # we don't want every command to update the figure
PyPlot.ioff() PyPlot.ioff()
end end