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

Launch failure caused by TypeError __root__ instead of pydantic.RootModel #207

Closed
jonititan opened this issue Jul 12, 2023 · 3 comments
Closed

Comments

@jonititan
Copy link

jonititan commented Jul 12, 2023

I've tried installing 0.3.1,0.3.2, & 0.3.3 into a clean new environment from conda but all fail to launch from the shell with the same error. Also fails when installed from pip. Tried this on Linux 22 & Windows 10

launch is as instructed in documentation

jupyter cad

Traceback (most recent call last):

  File "/home/jonititan/miniconda3/envs/cad/bin/jupyter-cad", line 6, in <module>

    from jupytercad.cadapp import main

  File "/home/jonititan/miniconda3/envs/cad/lib/python3.10/site-packages/jupytercad/__init__.py", line 4, in <module>

    from .notebook import *  # noqa

  File "/home/jonititan/miniconda3/envs/cad/lib/python3.10/site-packages/jupytercad/notebook/__init__.py", line 1, in <module>

    from .cad_document import CadDocument  # noqa

  File "/home/jonititan/miniconda3/envs/cad/lib/python3.10/site-packages/jupytercad/notebook/cad_document.py", line 15, in <module>

    from jupytercad.notebook.objects._schema.any import IAny

  File "/home/jonititan/miniconda3/envs/cad/lib/python3.10/site-packages/jupytercad/notebook/objects/__init__.py", line 8, in <module>

    from ._schema.jcad import Parts, ShapeMetadata  # noqa

  File "/home/jonititan/miniconda3/envs/cad/lib/python3.10/site-packages/jupytercad/notebook/objects/_schema/jcad.py", line 49, in <module>

    class JcadModel(BaseModel):

  File "/home/jonititan/miniconda3/envs/cad/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 95, in __new__

    private_attributes = inspect_namespace(

  File "/home/jonititan/miniconda3/envs/cad/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 279, in inspect_namespace

    raise TypeError("To define root models, use `pydantic.RootModel` rather than a field called '__root__'")

TypeError: To define root models, use `pydantic.RootModel` rather than a field called '__root__'
@trungleduc
Copy link
Member

Hi, can you try to downgrade pydantic to 1.10.11?

@jonititan
Copy link
Author

I downgraded using

conda install pydantic=1.10.11 

and it now works on both the linux and the windows machine.

Thank you

@martinRenou
Copy link
Member

I believe we should keep the issue open to track supporting the latest pydantic

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