Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGF backend tests failing #2403

Closed
mdboom opened this issue Sep 10, 2013 · 5 comments
Closed

PGF backend tests failing #2403

mdboom opened this issue Sep 10, 2013 · 5 comments
Assignees

Comments

@mdboom
Copy link
Member

mdboom commented Sep 10, 2013

I suspect this was introduced in #2391 or #2402.

All of the pgf backend tests are failing for me in the same way (on Fedora 19 Linux with the standard texlive packages), both Python 2.7 and 3.3. This failure is not happening on Travis, so I suspect it's something to do with the difference in TeX environments.

ERROR: matplotlib.tests.test_backend_pgf.test_xelatex                                                                                                                                         [188/238]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mdboom/python3/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/tests/test_backend_pgf.py", line 51, in backend_switcher
    result = func(*args, **kwargs)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/tests/test_backend_pgf.py", line 95, in test_xelatex
    compare_figure('pgf_xelatex.pdf')
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/tests/test_backend_pgf.py", line 62, in compare_figure
    plt.savefig(actual)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/pyplot.py", line 566, in savefig
    res = fig.savefig(*args, **kwargs)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/figure.py", line 1437, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backend_bases.py", line 2224, in print_figure
    **kwargs)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_pgf.py", line 884, in print_pdf
    self._print_pdf_to_fh(fh, *args, **kwargs)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_pgf.py", line 838, in _print_pdf_to_fh
    self.print_pgf(fname_pgf, *args, **kwargs)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_pgf.py", line 820, in print_pgf
    self._print_pgf_to_fh(fh, *args, **kwargs)
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_pgf.py", line 799, in _print_pgf_to_fh
    RendererPgf(self.figure, fh),
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_pgf.py", line 411, in __init__
    self.latexManager = LatexManagerFactory.get_latex_manager()
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_pgf.py", line 225, in get_latex_manager
    new_inst = LatexManager()
  File "/home/mdboom/python3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-linux-x86_64.egg/matplotlib/backends/backend_pgf.py", line 311, in __init__
    raise LatexError("LaTeX returned an error, probably missing font or error in preamble:
%s" % stdout)
matplotlib.backends.backend_pgf.LatexError: LaTeX returned an error, probably missing font or error in preamble:
b'This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)
 restricted \\write18 enabled.
**entering extended mode
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 2 languages 
loaded.

*(/usr/share/texlive/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
(Please type a command or say `\\end\')
*
*(/usr/share/tex
live/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3names.sty
(/usr/share/texlive/texmf-
dist/tex/latex/l3kernel/l3bootstrap.sty))
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3basics.sty)
(/usr/share/texlive/texmf-dist
/tex/latex/l3kernel/l3expan.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3tl.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3seq.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l
3kernel/l3int.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3quark.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3prg.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3c
list.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3token.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3prop.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3msg.sty)\
n(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3file.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3skip.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3keys.sty)
(/usr/sha
re/texlive/texmf-dist/tex/latex/l3kernel/l3fp.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3box.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3coffins.sty)
(/usr/share/texlive
/texmf-dist/tex/latex/l3kernel/l3color.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3luatex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3candidates.sty)
(/usr/share/texlive/
texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
(/usr/shar
e/texlive/texmf-dist/tex/latex/base/fixltx2e.sty)
*************************************************
* LaTeX warning: "xparse/redefine-command"
* 
* Redefining document command \\oldstylenums with
 arg. spec. \'m\' on line 128.
*************************************************
) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/bas
e/fontenc.sty

! Package fontenc Error: Encoding file `eu1enc.def\' not found.
(fontenc)                You might have misspelt the name of the encoding.

See the fontenc package documentation f
or explanation.
Type  H <return>  for immediate help.
 ...                                              

l.99 \\ProcessOptions*


No pages of output.
Transcript written on texput.log.
'

@pwuertz : Any thoughts?

@ghost ghost assigned pwuertz Sep 10, 2013
@pwuertz
Copy link
Contributor

pwuertz commented Sep 10, 2013

Does Travis run these tests? As far as I remember they are just skipped due to the missing LaTeX installation.

I had some trouble running the tests too. It seems that at some point python started mixing str and unicode instances and thus a few string comparisons I did are invalid. However, this bug most likely affects pdflatex on python 2.x only, so it is probably not the reason for your tests failing. Could you check https://github.com/pwuertz/matplotlib/tree/fix_unicode_comp if you have the time?

More importantly, could you test if your TeX system is able to compile this document with xelatex?

\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{fontspec}
\begin{document}
text
\begin{tikzpicture}
\draw (0,0) -- (1,1);
\draw (0,1) -- (1,0);
\end{tikzpicture}
$\mu$
\end{document}

@mdboom
Copy link
Member Author

mdboom commented Sep 10, 2013

Sorry for the noise -- I was able to resolve it by installing the texlive-euenc package. (Fedora's texlive packages are very fine-grained, so it's not uncommon to miss stuff like this). Is it worthwhile/practical to list all of the required LaTeX packages in the PGF backend docs?

@mdboom mdboom closed this as completed Sep 10, 2013
@pwuertz
Copy link
Contributor

pwuertz commented Sep 10, 2013

No problem, thanks to you I noticed that the pdflatex option was broken due to some unreliable string comparison in python2 :).
Concerning the documentation of LaTeX packages... I'm afraid that's a big can of worms. We would need separate lists for pdf/xe/lua-latex times number of linux + latex distributions, and to be honest, I don't even have a clue which packages exactly are required for a minimal tex environment ^^. Also, I don't think that we could keep track of the changes that might occur in the packaging of latex or the luatex development.

@tacaswell
Copy link
Member

Should we expect PGF to work with pdflatex?

I have been seeing a couple of PGF tests fail recently with error messages that more-or-less say 'install xelatex' which I have been putting off sorting out.

Are there anymore PGF patches coming to master in the near future? If not, (and it should work with pdflatex) I will spend some time at least get an issue opened.

@pwuertz
Copy link
Contributor

pwuertz commented Sep 10, 2013

Yes, PGF should work with pdflatex too. If you have only pdflatex installed all tests except the pdflatex test are skipped. Unfortunately the pdflatex test failed recently because "pdflatex" is not u"pdflatex" is True and thus xelatex packages were pulled in, causing the error you described.

With the modifications I added this evening everything should be back to normal. If pdflatex still fails this should indeed be addressed in a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants