noamgat / lm-format-enforcer

Enforce the output format (JSON Schema, Regex etc) of a language model
MIT License
994 stars 45 forks source link

Missing dependencies #79

Closed remixer-dec closed 4 months ago

remixer-dec commented 4 months ago

Hi, after installing lm-format-enforcer from pypi in a clean container, it fails to import some modules. Running from lmformatenforcer import CharacterLevelParser, JsonSchemaParser

  File "/usr/local/lib/python3.10/dist-packages/lmformatenforcer/external/jsonschemaobjectutil.py", line 29, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'
  File "/usr/local/lib/python3.10/dist-packages/lmformatenforcer/external/jsonschemaobjectutil.py", line 69, in <module>
    from yaml import CSafeLoader as SafeLoader
ModuleNotFoundError: No module named 'yaml'

installing packaging and PyYAML fixes this.

noamgat commented 4 months ago

This is likely to to a problematic version of poetry (1.8.0) that was released a while ago. Poetry 1.8.1 was released that fixes this problem, it should disappear on its own if you update.

On Mon, Feb 26, 2024 at 11:47 PM Remixer Dec @.***> wrote:

Hi, after installing lm-format-enforcer from pypi in a clean container, it fails to import some modules. Running from lmformatenforcer import CharacterLevelParser, JsonSchemaParser

File "/usr/local/lib/python3.10/dist-packages/lmformatenforcer/external/jsonschemaobjectutil.py", line 29, in from packaging import version ModuleNotFoundError: No module named 'packaging'

File "/usr/local/lib/python3.10/dist-packages/lmformatenforcer/external/jsonschemaobjectutil.py", line 69, in from yaml import CSafeLoader as SafeLoader ModuleNotFoundError: No module named 'yaml'

installing packaging and PyYAML fixes this.

— Reply to this email directly, view it on GitHub https://github.com/noamgat/lm-format-enforcer/issues/79, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKFA2HHR5OMCXUS2CJZZRTYVT7HLAVCNFSM6AAAAABD27BAMWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE2TKMRRHEYDSMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

remixer-dec commented 4 months ago

I don't think it has anything to do with poetry. These dependencies are not present in pyproject.toml and both pip and poetry do not install them.

noamgat commented 4 months ago

Fixed in v0.9.1