LineaLabs / lineapy

Move fast from data science prototype to pipeline. Capture, analyze, and transform messy notebooks into data pipelines with just two lines of code.
https://lineapy.org
Apache License 2.0
664 stars 58 forks source link

I can not start jupyter lab with lineapy #886

Closed fuhengwu2021 closed 11 months ago

fuhengwu2021 commented 1 year ago

python version: 3.8

lineapy version latest and HEAD of master

Your code:

$lineapy jupyter lab
/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:
* 'orm_mode' has been renamed to 'from_attributes'
  warnings.warn(message, UserWarning)
Traceback (most recent call last):
  File "/home/wukong/miniconda3/envs/docai/bin/lineapy", line 5, in <module>
    from lineapy.cli.cli import linea_cli
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/lineapy/__init__.py", line 3, in <module>
    from lineapy.api.api import (
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/lineapy/api/api.py", line 14, in <module>
    from lineapy.api.artifact_serializer import serialize_artifact
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/lineapy/api/artifact_serializer.py", line 6, in <module>
    from lineapy.api.api_utils import to_pickle
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/lineapy/api/api_utils.py", line 10, in <module>
    from lineapy.db.db import RelationalLineaDB
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/lineapy/db/db.py", line 12, in <module>
    from lineapy.data.types import (
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/lineapy/data/types.py", line 389, in <module>
    class LookupNode(BaseNode):
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 98, in __new__
    private_attributes = inspect_namespace(
  File "/home/wukong/miniconda3/envs/docai/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 337, in inspect_namespace
    raise PydanticUserError(
pydantic.errors.PydanticUserError: Field 'node_type' defined on a base class was overridden by a non-annotated attribute. All field definitions, including overrides, require a type annotation.

For further information visit https://errors.pydantic.dev/2.1.1/u/model-field-overridden

**Issue: I can not start jupyter lab with lineapy.

Notebook(s) or script(s) to reproduce the issue NA

dorx commented 1 year ago

Thanks for filling the bug, @fuhengwu2021! We're looking into it!

aayan636 commented 1 year ago

Hi @fuhengwu2021 , thanks for reaching out with the issue. As a first step, I attempted to reproduce the issue you were facing but was unable to do so. Could you also share the following:

  1. Exact python version (3.8.**)
  2. Link containing exact steps you used to install lineapy
  3. Judging by the log messages, seems like there might be an issue with Pydantic's version. Could you share the output of pip list | grep pydantic?
fuhengwu2021 commented 12 months ago
python 3.8.17

pip install lineapy

$pip list | grep pydantic
pydantic                     2.1.1
pydantic_core                2.4.0
aayan636 commented 12 months ago

Thanks @fuhengwu2021 for sharing. I installed pydantic==2.1.1 on my environment, and then running lineapy jupyter lab I was able to reproduce your issue. I have a strong confidence that pydantic's version is the cause for this issue. LineaPy depends on pydantic==1.9.0. Most likely there are breaking changes in pydantic >=2.0.0. Could you install LineaPy in a fresh conda/venv environment, run pip install lineapy (this will install correct versions of all libraries), and then try to run the command? Alternatively (though strongly not recommended, as you could break some other stuff on your machine) you could simply downgrade pydantic to 1.9.0 on your current environment and try rerunning the command. Let me know how it turns out.

fuhengwu2021 commented 11 months ago

Thanks @aayan636 it worked after pinning it to 1.9.0 :-)