Skip to content

[BUG] Missing pytz in package dependencies causes ModuleNotFoundError #365

@hdh7485

Description

@hdh7485

Description

plotly-resampler imports pytz in plotly_resampler/aggregation/plotly_aggregator_parser.py (line 8), but pytz is not declared as a dependency in pyproject.toml.

This causes ModuleNotFoundError: No module named 'pytz' in clean environments (e.g., CI, Docker, fresh virtualenvs) where pytz is not installed as a transitive dependency of another package.

Reproducing the bug

# In a clean virtualenv
pip install plotly-resampler==0.11.0
python -c "from plotly_resampler import FigureResampler"
Traceback (most recent call last):
  ...
  File ".../plotly_resampler/aggregation/plotly_aggregator_parser.py", line 8, in <module>
    import pytz
ModuleNotFoundError: No module named 'pytz'

Root cause

plotly_aggregator_parser.py has import pytz at line 8, but pyproject.toml [tool.poetry.dependencies] does not include pytz.

Suggested fix

Either:

  1. Add pytz = ">=2020.1" to [tool.poetry.dependencies] in pyproject.toml
  2. Or replace pytz usage with datetime.timezone (stdlib, no external dependency needed)

Environment information

  • Python version: 3.12
  • plotly-resampler version: 0.11.0
  • OS: Ubuntu (GitHub Actions runner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions