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

Basic Demo does not appear up to date #53

Open
DominiquePaul opened this issue Jan 24, 2024 · 4 comments
Open

Basic Demo does not appear up to date #53

DominiquePaul opened this issue Jan 24, 2024 · 4 comments
Labels
type:bug Something isn't working

Comments

@DominiquePaul
Copy link

Describe the bug:

Hi all, love the idea of the package.

I am trying to run the basic example in the readme:

import streamlit as st
from pydantic import BaseModel

import streamlit_pydantic as sp


class ExampleModel(BaseModel):
    some_text: str
    some_number: int
    some_boolean: bool


data = sp.pydantic_form(key="my_form", model=ExampleModel)
if data:
    st.json(data.json())

But I get the error:

PydanticImportError: BaseSettings has been moved to the pydantic-settings package. See https://docs.pydantic.dev/2.5/migration/#basesettings-has-moved-to-pydantic-settings for more details. For further information visit https://errors.pydantic.dev/2.5/u/import-error

I initially thought this might be duplicate of #52 or #38, but I the settings aren't directly imported in the code. Maybe it's easiest to update the code in the readme so the newbie's like me understand how to use this module :)

Technical details:

I am using python 3.11.7 and these package versions:

pydantic 2.5.3
pydantic_core 2.14.6
pydantic-settings 2.1.0
streamlit-pydantic 0.6.0

@DominiquePaul DominiquePaul added the type:bug Something isn't working label Jan 24, 2024
@PlebeiusGaragicus
Copy link

Still reporting the same error as above.

Great to see this repo updated, though!

@BGFGB
Copy link

BGFGB commented May 11, 2024

It works fine in master branch. Just do this: pip install git+https://github.com/LukasMasuch/streamlit-pydantic.git@main

@danilo-css
Copy link

@BGFGB Thanks. That's the issue. The pypi package is not up to date at the moment, but the git is.

@huguesmp
Copy link

@BGFGB @lukasmasuch

I'm on a corporate network at work and I can only install from pypi. Is it possible to package a release with the newest main branch improvements?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants