>
> Ok. So first of all, PyPlot is grabbing the system-wide installation of
> Python. I don't know how to tell PyPlot to look at the one that was
> installed with the Conda package.


https://github.com/JuliaPy/PyCall.jl#specifying-the-python-version

To force Julia to use its own Python distribution, via Conda, rather than
whatever is installed on your system, simply set ENV["PYTHON"] to the empty
string "" as described above.


Second, the errors are saying something about fonts, but I can't figure out
> what they are saying. I am also confused by the "permission denied" error:


Hard to say. Try checking the permissions of the files listed by
`fc-list`... Maybe something was installed with `sudo` that should not have
been.


On Wed, Nov 2, 2016 at 10:12 AM, Daniel Carrera <dcarr...@gmail.com> wrote:

> Hi everyone,
>
>
> I am getting some cryptic errors when I try to load PyPlot. It seems to be
> a problem on the Python end, but I'm not sure. I tried to use the "Conda"
> package so that Julia would have its own (hopefully not-broken) copy of
> Python, but that didn't help as PyPlot is still looking at the system-wide
> install of Python. Here are the messages in full (and some comments after
> ward). I decided to start from a completely clean install of Julia 0.5 (no
> packages) to make sure that there was no problem there:
>
> -----------------------------------
> $ mv ~/.julia/v0.5 ~/.julia/old-v0.5
> $ 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> Pkg.add("Conda")
> INFO: Initializing package repository /home/daniel/.julia/v0.5
> INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
> INFO: Installing BinDeps v0.4.5
> INFO: Installing Compat v0.9.3
> INFO: Installing Conda v0.3.2
> INFO: Installing JSON v0.8.0
> INFO: Installing SHA v0.2.1
> INFO: Installing URIParser v0.1.6
> INFO: Package database updated
>
> julia> Pkg.add("PyPlot")
> INFO: Installing ColorTypes v0.2.12
> INFO: Installing Colors v0.6.9
> INFO: Installing FixedPointNumbers v0.2.1
> INFO: Installing LaTeXStrings v0.2.0
> INFO: Installing MacroTools v0.3.2
> INFO: Installing PyCall v1.7.2
> INFO: Installing PyPlot v2.2.4
> INFO: Installing Reexport v0.0.3
> INFO: Building PyCall
> INFO: PyCall is using python (Python 2.7.12) at /usr/bin/python, libpython
> = libpython2.7
> INFO: Package database updated
>
> julia> using PyPlot
> INFO: Recompiling stale cache file /home/daniel/.julia/lib/v0.5/PyPlot.ji
> for module PyPlot.
> /usr/lib/python2.7/dist-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.')
> /usr/lib/python2.7/dist-packages/matplotlib/__init__.py:1352:
> 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)
> /usr/lib/python2.7/dist-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.')
> /usr/lib/python2.7/dist-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.')
> /usr/lib/python2.7/dist-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.')
> /usr/lib/python2.7/dist-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.
> /usr/lib/python2.7/dist-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 "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 29,
> in <module>
>     import matplotlib.colorbar
>   File "/usr/lib/python2.7/dist-packages/matplotlib/colorbar.py", line
> 34, in <module>
>     import matplotlib.collections as collections
>   File "/usr/lib/python2.7/dist-packages/matplotlib/collections.py", line
> 27, in <module>
>     import matplotlib.backend_bases as backend_bases
>   File "/usr/lib/python2.7/dist-packages/matplotlib/backend_bases.py",
> line 62, in <module>
>     import matplotlib.textpath as textpath
>   File "/usr/lib/python2.7/dist-packages/matplotlib/textpath.py", line
> 15, in <module>
>     import matplotlib.font_manager as font_manager
>   File "/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py",
> line 1421, in <module>
>     _rebuild()
>   File "/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py",
> line 1406, in _rebuild
>     fontManager = FontManager()
>   File "/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py",
> line 1059, in __init__
>     self.ttflist = createFontList(self.ttffiles)
>   File "/usr/lib/python2.7/dist-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(::Symbol) at ./loading.jl:394
> during initialization of module PyPlot
> -----------------------------------
>
>
> Ok. So first of all, PyPlot is grabbing the system-wide installation of
> Python. I don't know how to tell PyPlot to look at the one that was
> installed with the Conda package. Second, the errors are saying something
> about fonts, but I can't figure out what they are saying. I am also
> confused by the "permission denied" error:
>
> ERROR: InitError: PyError (:PyImport_ImportModule) <type
> 'exceptions.IOError'>
> IOError(13, 'Permission denied')
>
>
> All the files seem to be present and have sensible permissions:
>
> $ ls -l /usr/lib/python2.7/dist-packages/matplotlib/pyplot.py
> -rw-r--r-- 1 root root 123661 Mar 21  2016 /usr/lib/python2.7/dist-
> packages/matplotlib/pyplot.py
> $ ls -l /usr/lib/python2.7/dist-packages/matplotlib/font_manager.py
> -rw-r--r-- 1 root root 47824 Jan 10  2016 /usr/lib/python2.7/dist-
> packages/matplotlib/font_manager.py
>
>
> So... I'm stuck. I would appreciate any help you might offer.
>
> Cheers,
> Daniel.
>
>
>
>

Reply via email to