Python Error while generating LaTeX code snippets with Pygments and minted

Stefan Frede's Avatar

Stefan Frede

08 Oct, 2015 08:13 AM

Hi,

I try to narrow down the source of an error I get when I try to generate LaTeX code snippets with Pygments and minted inside Anki cards.

Because most of my cards are program language related I was searching for a good solution to display code snippets.

This is when I stumbled over this post: https://isching.wordpress.com/2011/12/17/howto-use-anki-flashcards-with-code-snippets-and-syntax-highlighting/.

After a bit of fiddling I got it working perfectly fine on the command line but not in Anki.

This is when I discovered this support request on mactex: http://tex.stackexchange.com/questions/247092/getting-the-latex-minted-package-to-work-in-anki, which is basically the same error I get.

Now I try to find out where the error is coming from and hope that after a whole day of searching the net without success I will get some new insights if not even a solution here.

I attached a text document where I tried to document everything as detailed as possible.

Thank you very much in advance.

Kind regards,

Stefan Frede

  1. Support Staff 1 Posted by Damien Elmes on 09 Oct, 2015 09:31 AM

    Damien Elmes's Avatar

    Hi Stefan,

    As this is not an issue with Anki per se, I'm afraid it's outside the scope of the support we can provide here. I will move your question to the community section, and perhaps one of our users will be able to assist.

  2. 2 Posted by Stefan Frede on 18 Oct, 2015 03:34 PM

    Stefan Frede's Avatar

    Hi Damien,

    after trying to narrow down this error I'm not 100% sure anymore that it is not an Anki issue.

    This is the error I get in Anki:

    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/apptemplate/lib/site.py", line 22, in
    zipimport.ZipImportError: can't decompress data; zlib not available

    But when I'm starting python on the command line, import zlib and then trigger it I get this output:

    module 'zlib' from '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/zlib.so'

    So it seems system wise it is definitely working.

    Because I'm not a python expert I have sadly no clue what is going on there in the end so if you are sure that it is no Anki issue I will no longer bother you.

    But at least I wanted to give it another try.

    All the best,
    - Stefan

  3. Support Staff 3 Posted by Damien Elmes on 20 Oct, 2015 11:59 AM

    Damien Elmes's Avatar

    Hi Stefan,

    Anki does not ship with a complete installation of Python, so if you're importing third party modules you'll need to make sure all their dependencies are available as well.

  4. System closed this discussion on 22 Feb, 2016 11:54 PM.

  5. Damien Elmes re-opened this discussion on 23 Feb, 2016 10:50 PM

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac