Summary
Trying to use the snowflake connectivity and as suggested added the package ‘snowflake-snowpark-python’ to the requirements.txt. But the app deployment does not install the package and deployment throws an exception.
requirements.txt:
pandas
streamlit
snowflake-snowpark-python
Steps to reproduce
Code snippet:
conn = st.experimental_connection('snowpark')
df = conn.query('select * from customers;', ttl=600)
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
The deployment should realize the changed requirements.txt file and initiate the module install. The snowflake connectivity should locate the module and use the snoflake API for connectivity.
Actual behavior:
Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.
Debug info
- Streamlit version: (get it with
$ streamlit version
) - Python version: (get it with
$ python --version
) - Using Conda? PipEnv? PyEnv? Pex?
- OS version:
- Browser version:
Requirements file
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.
pandas
streamlit
snowflake-snowpark-python
Links
- Link to your GitHub repo:
- Link to your deployed app: https://rakesh-k-streamlit-example-streamlit-app-y4qpgs.streamlit.app
Additional information
If needed, add any other context about the problem here.
ModuleNotFoundError: No module named 'snowflake'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.__dict__)
File "/mount/src/streamlit-example/streamlit_app.py", line 49, in <module>
conn = st.experimental_connection('snowpark')
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/connection_factory.py", line 298, in connection_factory
raise ModuleNotFoundError(f"{str(e)}. {extra_info}")
ModuleNotFoundError: No module named 'snowflake'. You need to install the 'snowflake-snowpark-python' package to use this connection.