Skip to content

Matplotlib is not an optional dependency #39

@olafmersmann

Description

@olafmersmann

When installing luxpy 1.12.5 into an empty virtual environment I get

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/olafm/tmp/luxpy-bug/.venv/lib/python3.13/site-packages/luxpy/__init__.py", line 203, in <module>
    from .color import cam
  File "/home/olafm/tmp/luxpy-bug/.venv/lib/python3.13/site-packages/luxpy/color/cam/__init__.py", line 163, in <module>
    from .colorappearancemodels import *
  File "/home/olafm/tmp/luxpy-bug/.venv/lib/python3.13/site-packages/luxpy/color/cam/colorappearancemodels.py", line 175, in <module>
    from .ciecam02 import run as ciecam02
  File "/home/olafm/tmp/luxpy-bug/.venv/lib/python3.13/site-packages/luxpy/color/cam/ciecam02.py", line 35, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

I guess matplotlib should be declared as a required dependency?

Exact steps to reproduce

In an empty directory run

uv add luxpy
echo "import luxpy as lx" > foo.py
uv run python foo.py

Dependency tree

When following the above steps, I get the following dependency tree

luxpy v1.12.5
├── numpy v2.4.2
└── scipy v1.17.0
    └── numpy v2.4.2

when using Python 3.13.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions