This is depressing... Installing a new matplotlib did not fix the problem at all. After I exited and restarted Julia the old error came right back, even with the new Python install:
------------------ Orion ~ % julia _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_) | Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release |__/ | x86_64-pc-linux-gnu julia> using PyPlot /home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') WARNING: No working GUI backend found for matplotlib. /home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/__init__.py:1357: UserWarning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time. warnings.warn(_use_error_msg) /home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') ERROR: InitError: PyError (:PyImport_ImportModule) <type 'exceptions.IOError'> IOError(13, 'Permission denied') File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/pyplot.py", line 29, in <module> import matplotlib.colorbar File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/colorbar.py", line 34, in <module> import matplotlib.collections as collections File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/collections.py", line 27, in <module> import matplotlib.backend_bases as backend_bases File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 62, in <module> import matplotlib.textpath as textpath File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/textpath.py", line 15, in <module> import matplotlib.font_manager as font_manager File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1421, in <module> _rebuild() File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1406, in _rebuild fontManager = FontManager() File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1059, in __init__ self.ttflist = createFontList(self.ttffiles) File "/home/daniel/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/font_manager.py", line 581, in createFontList font = ft2font.FT2Font(fpath) in pyerr_check at /home/daniel/.julia/v0.5/PyCall/src/exception.jl:56 [inlined] in pyerr_check at /home/daniel/.julia/v0.5/PyCall/src/exception.jl:61 [inlined] in macro expansion at /home/daniel/.julia/v0.5/PyCall/src/exception.jl:81 [inlined] in pyimport(::String) at /home/daniel/.julia/v0.5/PyCall/src/PyCall.jl:387 in __init__() at /home/daniel/.julia/v0.5/PyPlot/src/PyPlot.jl:235 in _include_from_serialized(::String) at ./loading.jl:150 in _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:187 in _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:217 in require(::Symbol) at ./loading.jl:371 during initialization of module PyPlot ------------------ Notice that it's now looking at my brand-new locally installed Python in ~/.julia/v0.5/Conda/deps What's perhaps more surprising is that I still see an IO error and a "Permission denied". How is that possible? I'm pretty sure I never typed "sudo" when I did any of this. Incidentally, I already tried removing the ~/.cache directory and it didn't help. Cheers, Daniel. On Wednesday, 2 November 2016 16:16:33 UTC+1, Daniel Carrera wrote: > > Thanks! Ok... getting close, but not quite there: > > Deleting ~/.cache/matplotlib and even ~/.cache/fontconfig didn't work for > me, but I figured out how to use Conda.jl to install matplotlib separately. > So I did this: > > $ sudo apt-get remove python-matplotlib > $ julia > > julia> Pkg.add("Conda") > julia> using Conda > julia> Conda.add("matplotlib") > julia> ENV["PYTHON"] = "/home/daniel/.julia/v0.5/Conda/deps/usr/bin/python" > julia> Pkg.add("PyPlot") > julia> using PyPlot > > Up to this point there are no errors! But this is what happens next: > > julia> plot( [1,2,3], [4,5,6] ) > ERROR: ArgumentError: haskey of NULL PyObject > in haskey(::PyCall.PyObject, ::String) at > /home/daniel/.julia/v0.5/PyCall/src/PyCall.jl:282 > in #plot#85(::Array{Any,1}, ::Function, ::Array{Int64,1}, > ::Vararg{Array{Int64,1},N}) at > /home/daniel/.julia/v0.5/PyPlot/src/PyPlot.jl:396 > in plot(::Array{Int64,1}, ::Vararg{Array{Int64,1},N}) at > /home/daniel/.julia/v0.5/PyPlot/src/PyPlot.jl:396 > > > I partially understand the error. I'll experiment a bit more to see if I > can resolve it, but I thought you'd like to know about it. > > Cheers, > Daniel. > > > > > so I think I'll switch to Conda Python. I figured out how to use Conda.jl > to get a separate matplotlib install > > > On Wednesday, 2 November 2016 15:29:31 UTC+1, Steven G. Johnson wrote: >> >> For the font-cache, see >> https://github.com/matplotlib/matplotlib/issues/5836 >> ...there is some ~/.cache/matplotlib directory that you can delete to get >> rid of this. >> >> To tell PyPlot to use the Conda Python, you need to set the PYTHON >> environment variable and re-build PyCall: >> >> ENV["PYTHON"]="" >> Pkg.build("PyCall") >> >