Newly added package in requirements.txt not installed in cloud

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

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.

What have you tried so far to solve the issue? Have you rebooted the app? (it sometimes does this)

Wonder how to reboot the cloud app? I would love to give it a shot if there is a way.

@rakstream
In the bottom-right corner of your app check “Manage app” (when you are logged-in to your streamlit account, you have access to this button whenever you visit the link of your apps):
image

Click on it and go to “Reboot app”:

That seemed to take care of it. But is it really how it is supposed to work? It is annoying to keep rebooting everytime I add or delete a package.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.