widgetti / solara

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

Failed to import solara if there's comm.py exists in path #580

Closed dannyp11 closed 1 month ago

dannyp11 commented 1 month ago

If I have a comm.py file in the main path, import solara will fail

Version

Reproduce step

touch comm.py 
python3 -c "import solara"

Error:

$ python3 -c "import solara"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/danny/.local/lib/python3.8/site-packages/solara/__init__.py", line 7, in <module>
    from . import comm  # noqa: F401
  File "/home/danny/.local/lib/python3.8/site-packages/solara/comm.py", line 12, in <module>
    if comm is not None and comm.create_comm is comm._create_comm:
AttributeError: module 'comm' has no attribute 'create_comm'

If I remove the comm.py, import is fine. Is this an expected behavior? If not I can help raising PR if needed lmk tysm

dannyp11 commented 1 month ago

turns out solara depends on comm package from ipykernel, closing issue