streamlit-jupyter icon indicating copy to clipboard operation
streamlit-jupyter copied to clipboard

AttributeError: module 'streamlit' has no attribute 'experimental_data_editor'

Open ann8ty opened this issue 1 year ago • 8 comments

python 3.11.9 streamlit==1.38.0 streamlit-jupyter==0.2.1

notebook:

import streamlit as st

from streamlit_jupyter import StreamlitPatcher, tqdm

sp = StreamlitPatcher()
sp.jupyter()  # register streamlit with jupyter-compatible wrappers

AttributeError Traceback (most recent call last) Cell In[4], line 6 3 from streamlit_jupyter import StreamlitPatcher, tqdm 5 sp = StreamlitPatcher() ----> 6 sp.jupyter() # register streamlit with jupyter-compatible wrappers

File ~/code/data/data-workflows/.venv/lib/python3.11/site-packages/streamlit_jupyter/core.py:53, in StreamlitPatcher.jupyter(self) 51 # patch streamlit methods from MAPPING property dict 52 for method_name, wrapper in self.MAPPING.items(): ---> 53 self._wrap(method_name, wrapper) 55 self.is_registered = True

File ~/code/data/data-workflows/.venv/lib/python3.11/site-packages/streamlit_jupyter/core.py:79, in _wrap(cls, method_name, wrapper) 69 """make a streamlit method jupyter friendly 70 71 Parameters (...) 76 wrapper function to use 77 """ 78 if IN_IPYTHON: # only patch if in jupyter ---> 79 trg = getattr(st, method_name) # get the streamlit method 80 setattr(st, method_name, wrapper(trg)) # patch the method 81 cls.registered_methods.add(method_name)

AttributeError: module 'streamlit' has no attribute 'experimental_data_editor'

ann8ty avatar Sep 18 '24 20:09 ann8ty

I have the same issue

iSevenDays avatar Sep 23 '24 09:09 iSevenDays

I had the same problem. I download it directly from the master and it works for me.

pip install git+https://github.com/ddobrinskiy/streamlit-jupyter.git

ahmad88me avatar Oct 21 '24 12:10 ahmad88me

I had the same problem. I download it directly from the master and it works for me.

pip install git+https://github.com/ddobrinskiy/streamlit-jupyter.git

This didn't work for me unfortunately

brunocastroibarburu94 avatar Nov 04 '24 10:11 brunocastroibarburu94

After some digging it turns out that "experimental_data_editor" has been deprecated in version 1.23.0, the fix should be straightforward as to replace "experimental_data_editor" to data_editor, is this package actively maintained?

https://docs.streamlit.io/1.29.0/develop/api-reference/data/st.experimental_data_editor

brunocastroibarburu94 avatar Nov 04 '24 10:11 brunocastroibarburu94

This didn't work for me unfortunately

@brunocastroibarburu94 it works. the version hasn't been bumped (and the package hasn't been released to pypi). if you uninstall it, and then install it again anew by pointing to github (so it doesn't skip the update because it doesn't see a version change) it should work - it did for me.

From the commit history, the package seems to be "semi" maintained. Indeed this fix is present, but not "released".

I'm surprised this isn't a more common ask from the streamlit community, as i would have assumed a large part of that community overlaps with the jupyter one and would want to develop in this way, ie using jupyter nb, jupytext and streamlit.

DayalStrub avatar Nov 08 '24 11:11 DayalStrub

Hello, @ddobrinskiy First of all, thank you for the awesome library.

As @DayalStrub mentioned, in my thought, this issue is already treated in https://github.com/ddobrinskiy/streamlit-jupyter/commit/d853e723b5e8b61fe67d847ab90e0363bf06ace8 commit. But it's not applied to the newest version in PyPI.

In addition, publishing to PyPI seems to be intended to be automatic process using GitHub action as stated in https://github.com/ddobrinskiy/streamlit-jupyter/issues/7 issue. But it seems that release in PyPI is not working in these days as you can see in PyPI Release History.

So, could you check it or release the changes/fixes to PyPI version?

4Urban avatar Mar 01 '25 13:03 4Urban

I think this is an issue related to the Streamlit version. In the requirements of streamlit-jupyter, the requirement is streamlit>=1.19, while versions up to 1.38 didn't work for me. For now, I'm stuck using the version 1.35 from streamlit, and it is working just fine. Maybe the highest available version is another one, but I didn't try going one by one to check which is the actual breaking version from streamlit

JulenCestero avatar Mar 20 '25 09:03 JulenCestero

I found too, @brunocastroibarburu94, editing the line in core.py and changing the kwarg experimental_data_editor to data_editor worked for me too

shazoom avatar May 07 '25 01:05 shazoom

@ddobrinskiy, could you please make a release to pypi with the latest changes, to help the community not have to install from the git repo directly?

behnam-oneschema avatar Jul 22 '25 10:07 behnam-oneschema

Sorry gang, it's been crazy couple of years.

Getting back to maintaining this repo, looking into it now

ddobrinskiy avatar Jul 22 '25 12:07 ddobrinskiy

Just made a release to PyPi

  • https://pypi.org/project/streamlit-jupyter/0.3.1/
  • https://github.com/ddobrinskiy/streamlit-jupyter/releases/tag/v0.3.1

tested with streamlit 1.43.0 on my machine

@behnam-oneschema @shazoom @JulenCestero @4Urban @DayalStrub @ahmad88me @brunocastroibarburu94 @ann8ty could you kindly check that the default installation via pip install streamlit-jupyter now works for you?

if not, please share your streamlit version and error message

ddobrinskiy avatar Jul 22 '25 12:07 ddobrinskiy

Thanks again @ddobrinskiy, for taking the time! I confirmed that all is good with pip via pypi. I guess you can close this issue now.

behnam-oneschema avatar Jul 29 '25 02:07 behnam-oneschema

fixed in v0.3.1

ddobrinskiy avatar Jul 30 '25 10:07 ddobrinskiy