nschloe / tikzplotlib

:bar_chart: Save matplotlib figures as TikZ/PGFplots for smooth integration into LaTeX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

future feature annotations is not defined

klieret opened this issue · comments

The setup.cfg states that tikzplotlib works with python 3.6. However _save.py uses

from __future__ import annotations

which is only available from python 3.7 onward.

Hence:

In [3]: import tikzplotlib

Traceback (most recent call last):

  File "/cvmfs/belle.cern.ch/ubuntu1804/externals/v01-06-01/Linux_x86_64/common/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-3-f7494fee2594>", line 1, in <module>
    import tikzplotlib

  File "/cvmfs/belle.cern.ch/ubuntu1804/externals/v01-06-01/Linux_x86_64/opt/root/lib/ROOT.py", line 303, in _importhook
    return _orig_ihook( name, *args, **kwds )

  File "/filer/z-sv-pool12c/k/Kilian.Lieret/.python-envs/tagcal/lib/python3.6/site-packages/tikzplotlib/__init__.py", line 5, in <module>
    from ._save import Flavors, get_tikz_code, save

  File "/cvmfs/belle.cern.ch/ubuntu1804/externals/v01-06-01/Linux_x86_64/opt/root/lib/ROOT.py", line 303, in _importhook
    return _orig_ihook( name, *args, **kwds )

  File "/filer/z-sv-pool12c/k/Kilian.Lieret/.python-envs/tagcal/lib/python3.6/site-packages/tikzplotlib/_save.py", line 1
    from __future__ import annotations
                                      ^
SyntaxError: future feature annotations is not defined

This was introduced in f1c0c09

So a quick fix for everyone on py 3.6 is to downgrade to < 0.9.13