-
Notifications
You must be signed in to change notification settings - Fork 67
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
Update st.cache to st.cache_data ro cache_resource #17
Comments
I kept wondering if the code had some issue. Apparently, this library needs an update. |
Is there a work around? I have an error in my home page displaying that I can't get rid of. |
I think we need to fork the repo then fix it. There r no respondence from author |
I can't even find where the problem is at. I can't find a reference in the code |
There is no direct use in the code but the dependencies it builds. The dependencies it installs, somewhere it has this cache method that is outdated and it causes an issue during runtime. If it were there directly in the code, we would have fixed it already and used it as is. Maybe update your streamlit versions etc in the base environment and then use this library once. You'd see the issue. I'll try to share some reproducible code here for what gave the error. Btw. I did make it vanish by force removing the warning or something I believe. It's working for me. View the page. |
Possible for you to share screenshots etc for where the issue came in? |
I hid the alert div. Is that how you managed to hide it? Also, I found the culprit and there's a pull request that hasn't been accepted :(. It's literally one line |
Solution to the st.cache deprecation problem.I was able to find a way through:
|
Discovered the usage of |
@RyanBin0126
Awesome!!. I understand your solution theoretically, I will try it out
practically to see it in action.
…On Thu, Jun 22, 2023, 3:22 PM RyanBin ***@***.***> wrote:
I found *st.cache* in "from streamlit_cookies_manager import
*EncryptedCookieManager*".
Though I changed *st.cache* to *st.cache_data*, i still received a
warning.
I am keeping looking the other *st.cache*.
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7EDH77DJZ3Z6HJOGN4EQ3LXMQ2GXANCNFSM6AAAAAAXWUA6RQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@RyanBin0126 How do you refactor the st.cache to st.cache_data in Pycharm? I cant find the streamlit-cookies-manager module where st.cache is, presumably, initially declared. |
@Klein-Baru The first method is more convenient for those who are using PyCharm. The second method is to directly open the file Miniconda3\envs"your envs"\Lib\site-packages\streamlit_cookies_manager\encrypted_cookie_manager.py in the system and make the modification. Good luck! |
Tried method 1 on Pycharm, the warning disappeared!! Thanks for sharing. |
tried |
The On the other hand, finding the Cheers for both interim solutions, nonetheless ! Will be looking forward to the bug-fix in a future release of |
So I found the encrypted_cookie_manager.py and @st.cache in line 14. When trying to change to @st.cache_data I can't save it and get this error message: Failed to save 'encrypted_cookie_manager.py': Unable to write file 'vscode-remote://wsl+ubuntu/usr/local/lib/python3.10/dist-packages/streamlit_cookies_manager/encrypted_cookie_manager.py' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/usr/local/lib/python3.10/dist-packages/streamlit_cookies_manager/encrypted_cookie_manager.py') Already tried to change the permission but I still can't save it. |
Try modifying it in a local file instead of the pycharm editor |
Someone wants to make a PR to solve this in main ? |
Hi maintainer,
As st.cache depreciated on streamlit, please update to other method
The text was updated successfully, but these errors were encountered: