widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.62k stars 105 forks source link

Issue with pip install of solara version 1.32.1? #630

Closed kdheepak closed 1 week ago

kdheepak commented 2 weeks ago

I have the following project:

$ poetry run pip list | rg solara
solara                    1.32.1
solara-server             1.32.1
solara-ui                 1.32.1

however when I try to import solara, I have issues:

image

Is there an issue with bundling perhaps?

kdheepak commented 2 weeks ago

Version 1.32.0 appears to be working fine:

image

iisakkirotko commented 2 weeks ago

Hi @kdheepak!

I tried in fresh environments, as well as upgrading from an old version, using both pip and conda, but everything seemed to work as expected. I didn't try using poetry, so it could be that the issue is isolated to poetry. I'll give that a try soon. Is the project you experienced this with new, or did you upgrade from a previous version of Solara?

kdheepak commented 2 weeks ago

I upgraded from a previous version but also deleted the poetry.lock file and was still able to reproduce this issue, so that was effectively a new project.

kdheepak commented 2 weeks ago

This was happening on Windows btw

mariobuikhuizen commented 2 weeks ago

I tried it on windows and couldn't reproduce the issue. This worked for me:

micromamba create -n poetry-solara -c conda-forge python=3.11 pip poetry
micromamba activate poetry-solara
poetry new poetry-solara
cd .\poetry-solara\
poetry add solara
notepad app.py
solara run app.py
maartenbreddels commented 1 week ago

From your screenshot, Python thinks solara is a namespace package (probably an empty directory left over for unknown reasons?). You can take a look at solara.__path__ to debug this yourself, possibly remove this directory by hand.