I have built a streamlit app inside snowflake account; but now i want the streamlit app public facing, so I am trying to move my streamlit app to Streamlit.
In streamlit app, I am able to connect to snowflake account and create a session by using:
from snowflake.snowpark import Session
session = Session.builder.configs(st.secrets["connections"]["snowflake"]).create()
I want to do the same thing in the Steamlit with the following code:
from snowflake.core import Root
from snowflake.snowpark import Session
session = Session.builder.configs(st.secrets["connections"]["snowflake"]).create()
root = Root(session)
svc = root.databases[CORTEX_SEARCH_DATABASE].schemas[CORTEX_SEARCH_SCHEMA].cortex_search_services[CORTEX_SEARCH_SERVICE]
but streamlit app throws errors : modulenotfound “snowflake.core”, which I tried to put it in my environment.yaml file.
My end goal is to utilize cortex search service in my public facing streamlit. Could you please assist?
Can you check the console logs for your app and see if it’s able to install everything properly, or if there is an error when it’s trying to install.
If that doesn’t help, I would try one of two things to try and get it working:
Switch your channels list to just be - conda-forge
How did you chose those specific libraries to install? It doesn’t look like any of them provides snowflake.core. I think you need to install snowflake or snowflake.core. Review the snowflake documentation.
Thanks blackary. I used requirements.txt in my initial attempt and it didn’t work. so i switched to environments.yml file and it stil didn’t work. After several attempts, i switched back to requirements.txt… now it works… not sure what I had done wrong at the initial try…