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

Pydantic version must be <2 and >=1.10.0 (Python 3.11 and ICE 0.5.0) #326

Open
miloknowles opened this issue Feb 20, 2024 · 0 comments
Open

Comments

@miloknowles
Copy link

Context

I ran into some dependency issues when going through the Ought ICE primer. I thought I'd share the fix in case anyone else is in the same situation. For context, I'm using Python 3.11, and ought-ice == 0.5.0 installed via pip.

Problem

Due to #312, I needed to use pydantic < 2. I had Pydantic 1.9.x in my virtual environment, so I thought it would be compatible. But then I got this eventual error when importing ice:

  File "/Users/miloknowles/envs/ought-primer-SDTjr-vl/lib/python3.11/site-packages/pydantic/utils.py", line 258, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "/Users/miloknowles/.pyenv/versions/3.11.7/lib/python3.11/inspect.py", line 2725, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'not' is not a valid parameter name

Solution

Due to this issue with FastAPI, I needed to upgrade to pydantic >= 1.10.0. This fixed the above error.

Maybe it would be helpful to pin a more precise version of Pydantic?

@miloknowles miloknowles changed the title Pydantic version must be "<2" and ">=1.10.0" (Python 3.11 and ICE 0.5.0) Pydantic version must be <2 and >=1.10.0 (Python 3.11 and ICE 0.5.0) Feb 20, 2024
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

1 participant