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 2 does not support all of the V1 capabilities #779

Open
chrand opened this issue Oct 14, 2023 · 5 comments
Open

Pydantic 2 does not support all of the V1 capabilities #779

chrand opened this issue Oct 14, 2023 · 5 comments

Comments

@chrand
Copy link

chrand commented Oct 14, 2023

hello. Trying to launch zwave-js-server-python, but it terminates with import error.
Install was done with pip3 install zwave-js-server-python
Launching it, I get the error below:

$ ./zwave-js-server-python
Traceback (most recent call last):
  File "./zwave-js-server-python", line 5, in <module>
    from zwave_js_server.__main__ import main
  File "/home/chr/.local/lib/python3.8/site-packages/zwave_js_server/__main__.py", line 9, in <module>
    from .client import Client
  File "/home/chr/.local/lib/python3.8/site-packages/zwave_js_server/client.py", line 28, in <module>
    from .model.driver import Driver
  File "/home/chr/.local/lib/python3.8/site-packages/zwave_js_server/model/driver.py", line 4, in <module>
    from pydantic import create_model_from_typeddict
  File "/home/chr/.local/lib/python3.8/site-packages/pydantic/__init__.py", line 218, in __getattr__
    return _getattr_migration(attr_name)
  File "/home/chr/.local/lib/python3.8/site-packages/pydantic/_migration.py", line 300, in wrapper
    raise PydanticImportError(f'`{import_path}` has been removed in V2.')
pydantic.errors.PydanticImportError: `pydantic:create_model_from_typeddict` has been removed in V2.

For further information visit https://errors.pydantic.dev/2.4/u/import-error
@raman325
Copy link
Contributor

Downgrade pydantic to 1.10 and everything should work as is. Thanks for the report though, maybe we aren't as ready for pydantic 2 as we thought

@chrand
Copy link
Author

chrand commented Oct 15, 2023

np. happy to have helped testing.
thanks for a nice client library!

@raman325 raman325 changed the title zwave-js-server-python: error at launch Pydantic 2 does not support all of the V1 capabilities Oct 15, 2023
@allenporter
Copy link

It seems like its available in the v1 shims, so that is surprising:

$ pip3 install pydantic==2.4.2
$ python3
>>> from pydantic.v1 import create_model_from_typeddict
>>> 

@raman325
Copy link
Contributor

hmm that's weird. @chrand is it possible you were on an earlier version of v2 that didn't have this shim?

@allenporter
Copy link

allenporter commented Oct 16, 2023

Is this just an older version of zwave-js-server-python without the shims? Seems like it could be based on the line numbers.

Edit: Yeah, would be helpful to know version of zwave-js-server-python and pydantic involved

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

3 participants