Skip to content

[Bug]: No module named 'diskcache' #11503

@jamesbraza

Description

@jamesbraza

What happened?

With Python 3.11 and after pip install litellm==1.72.1:

from litellm.caching import Cache

Cache(type="disk")

Can litellm make an extra for diskcache, to avoid the ModuleNotFoundError

Relevant log output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path/to/.venv/lib/python3.11/site-packages/litellm/caching/caching.py", line 205, in __init__
    self.cache = DiskCache(disk_cache_dir=disk_cache_dir)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/.venv/lib/python3.11/site-packages/litellm/caching/disk_cache.py", line 16, in __init__
    import diskcache as dc
ModuleNotFoundError: No module named 'diskcache'

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

1.72.1

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions