[Python] Python & Matplotlib: PANIC: unprotected error in call to Lua API (zlib library...

Discussão em 'Python' iniciado por Stack, Julho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I've been facing an issue recently when using custom matplotlib stylesheets on my Linux PC. Say I have a custom stylesheet named madeup.mplstyle. The style has run perfectly on a Windows kernel and even on other Linux PCs (Ubuntu), but as soon as I execute my plotting script on a Linux PC running Linux Mint, I get errors like so:

    PANIC: unprotected error in call to Lua API (zlib library version does not match - header: 1.2.11, library: 1.3.1)

    I understood this might be due to incompatibilities between my system's zlib version and matplotlib, so I decided to create an isolated virtual environment from my system's libraries using conda which I installed through Miniforge. As soon as I create the virtual environment, the script runs, but it then prompts a warning as shown bellow:

    Missing colon in file PosixPath('/home/user/.config/matplotlib/stylelib/madeup.mplstyle'), line 8 ("'#820e21', ")
    Missing colon in file PosixPath('/home/user/.config/matplotlib/stylelib/madeup.mplstyle'), line 9 ("'#633e88', ")
    Missing colon in file PosixPath('/home/user/.config/matplotlib/stylelib/madeup.mplstyle'), line 10 ("'#E89E0B', ")
    Missing colon in file PosixPath('/home/user/.config/matplotlib/stylelib/madeup.mplstyle'), line 11 ("'#7DA21B', ")
    Missing colon in file PosixPath('/home/user/.config/matplotlib/stylelib/madeup.mplstyle'), line 12 ("'#091932', ")


    This throws me off a lot because I'm confident the colour list is specified correctly in the .mplstyle file as this has worked in other systems before. However, when I run the command plt.style.use(madeup) in my script, the file seems to have an issue when reading the colour palette for the graph. All other properties in the stylesheet seem to be captured correctly. Has anybody faced this kind of issue before? I am at a loss because I still face this issue after creating ad hoc virtual environment with conda and yet face these kind of issues. Could anybody help me out?

    Continue reading...

Compartilhe esta Página