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

ReliabilityDiagram fails to import because of tikzplotlib #53

Closed
Praisethefab opened this issue Mar 11, 2024 · 2 comments
Closed

ReliabilityDiagram fails to import because of tikzplotlib #53

Praisethefab opened this issue Mar 11, 2024 · 2 comments

Comments

@Praisethefab
Copy link

When trying to plot a ReliabilityDiagram I got this traceback:

File "REDACTED", line 31, in
from netcal.presentation import ReliabilityDiagram
File "REDACTED.venv\Lib\site-packages\netcal\presentation_init_.py", line 25, in
from .ReliabilityDiagram import ReliabilityDiagram
File "REDACTED.venv\Lib\site-packages\netcal\presentation\ReliabilityDiagram.py", line 14, in
import tikzplotlib
File "REDACTED.venv\Lib\site-packages\tikzplotlib_init_.py", line 5, in
from ._save import Flavors, get_tikz_code, save
from . import _axes
File "REDACTED.venv\Lib\site-packages\tikzplotlib_axes.py", line 3, in
from matplotlib.backends.backend_pgf import (
ImportError: cannot import name 'common_texification' from 'matplotlib.backends.backend_pgf' (REDACTED.venv\Lib\site-packages\matplotlib\backends\backend_pgf.py)

This seems to me to be caused by this issue in the tikzplotlib library and a quick fix would be to downgrade matplotlib to before 3.8.

@tfriedel
Copy link

workaround:
Don't use tikz and monkey patch it.

import sys
import types

# Create a dummy module
dummy_module = types.ModuleType('tikzplotlib')

# Insert the dummy module into sys.modules
sys.modules['tikzplotlib'] = dummy_module

@fabiankueppers
Copy link
Collaborator

Hi everyone, which python version is affected of this issue? Would be very helpful to get more details about the environments you used. Thanks

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