Open johnnyb1509 opened 1 year ago
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 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
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.
I think we need to fork the repo then fix it. There r no respondence from author
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 https://github.com/ktosiek/streamlit-cookies-manager/pull/3
I was able to find a way through:
streamlit run <python file>
command. Thus to suppress the warnings, use streamlit run <python file> --client.showErrorDetails=false
solutions above are for local host only. Online deployment has not been tested.
Discovered the usage of st.cache
in the import statement from streamlit_cookies_manager import EncryptedCookieManager
. I refactored the code by replacing st.cache
with st.cache_data
. After restarting PyCharm and reloading the Streamlit app, the warning was resolved.
@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 https://github.com/GauriSP10/streamlit_login_auth_ui/issues/17#issuecomment-1602542845, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7EDH77DJZ3Z6HJOGN4EQ3LXMQ2GXANCNFSM6AAAAAAXWUA6RQ . You are receiving this because you commented.Message ID: @.***>
@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.
@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.cachedata, 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 There are two methods.
The first method is more convenient for those who are using PyCharm. At the place where you initially imported "from streamlit_login_auth_ui.widgets import login", hold the Ctrl key and click on "login" with the mouse. You will be taken to "widgets.py". At the top of the .py file, you will see "from streamlit_cookies_manager import EncryptedCookieManager". Next, jump into the py file "encrypted_cookie_manager" where "EncryptedCookieManager" is located. Line 14, above the method "key_from_parameters", you will find "@st.cache". You can modify it there.
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!
@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.cachedata, 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 There are two methods.
The first method is more convenient for those who are using PyCharm. At the place where you initially imported "from streamlit_login_auth_ui.widgets import login", hold the Ctrl key and click on "login" with the mouse. You will be taken to "widgets.py". At the top of the .py file, you will see "from streamlit_cookies_manager import EncryptedCookieManager". Next, jump into the py file "encrypted_cookie_manager" where "EncryptedCookieManager" is located. Line 14, above the method "key_from_parameters", you will find "@st.cache". You can modify it there.
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!
@RyanBin0126
Tried method 1 on Pycharm, the warning disappeared!! Thanks for sharing.
tried streamlit run <python file> --client.showErrorDetails=false
on deployment and works ok for now..
The --client.showErrorDetails=false
option does work-- on the browser (the web-page for login does not show up the warning), but in test environment the warning is still shown on the terminal where the streamlit app is being run.
On the other hand, finding the encrypted_cookie_manager.py
file and replacing @st.cache
with @st.cache_resource
solves the issue on a deeper level-- the warning vanishes from the login page on the browser, as well as on the terminal where the app is being run.
Cheers for both interim solutions, nonetheless !
Will be looking forward to the bug-fix in a future release of streamlit-login-auth-ui
.
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.
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