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

supabase import error: Pydantic 'bases' has incorrect type #587

Closed
bji219 opened this issue Oct 13, 2023 · 2 comments
Closed

supabase import error: Pydantic 'bases' has incorrect type #587

bji219 opened this issue Oct 13, 2023 · 2 comments

Comments

@bji219
Copy link

bji219 commented Oct 13, 2023

Bug report

Traceback (most recent call last):
  File "Send_Data.py", line 2, in <module>
    from supabase import create_client, Client
  File "/home/pi/.local/share/virtualenvs/PlantDatabase-xla7VizZ/lib/python3.7/site-packages/supabase/__init__.py", line 1, in <module>
    from postgrest import APIError as PostgrestAPIError
  File "/home/pi/.local/share/virtualenvs/PlantDatabase-xla7VizZ/lib/python3.7/site-packages/postgrest/__init__.py", line 7, in <module>
    from ._async.client import AsyncPostgrestClient
  File "/home/pi/.local/share/virtualenvs/PlantDatabase-xla7VizZ/lib/python3.7/site-packages/postgrest/_async/client.py", line 15, in <module>
    from .request_builder import AsyncFilterRequestBuilder, AsyncRequestBuilder
  File "/home/pi/.local/share/virtualenvs/PlantDatabase-xla7VizZ/lib/python3.7/site-packages/postgrest/_async/request_builder.py", line 8, in <module>
    from ..base_request_builder import (
  File "/home/pi/.local/share/virtualenvs/PlantDatabase-xla7VizZ/lib/python3.7/site-packages/postgrest/base_request_builder.py", line 108, in <module>
    class APIResponse(BaseModel):
  File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
TypeError: Argument 'bases' has incorrect type (expected list, got tuple)

Describe the bug
Trying to run supabase python client and running into a compatibility error with pydantic on import,

Here is my virtual environment using pipenv:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
board = "*"
adafruit-seesaw = "*"
adafruit-blinka = "*"
adafruit-circuitpython-seesaw = "*"
requests = "*"
supabase = "*"
pydantic = "*"
postgrest = "*"

[dev-packages]

[requires]
python_version = "3.7"

To Reproduce
Install packages same as in above pipfile, try importing supabase,

System information
Running python 3.7 on a Raspberry Pi 3B+ (Linux, raspbian)

@bji219
Copy link
Author

bji219 commented Oct 13, 2023

SOLVED: For anyone else struggling with this issue- use the supabase-py package NOT the supabase package. So the ReadMe is incorrect in this repository, do not install the package called "supabase".

@bji219 bji219 closed this as completed Oct 13, 2023
@anand2312
Copy link
Contributor

anand2312 commented Oct 13, 2023

No, the readme is correct - https://pypi.org/project/supabase/ supabase-py is an old package that is not up-to-date.
See pydantic/pydantic#7689 for the cause - it's pydantic that's causing this error. Pinning pydantic to a version without this bug should fix it.

@anand2312 anand2312 reopened this Oct 13, 2023
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

2 participants