ModuleNotFoundError: No module named 'snowflake' getting error in streamlit

#import python
import streamlit as st
from snowflake.snowpark.functions import col

Write directly to the app

st.title(“:cup_with_straw: Customize your smoothies!:cup_with_straw:”)
st.write(
“”“Choose the fruit you want in your custom smoothie.
“””
)

#option = st.selectbox(‘Select any One:’, (“Banana”, “Apple”))
#st.write(‘Your selected option:’, option)

name_on_order = st.text_input(‘Name on Smoothie:’)
st.write(‘The name of your smoothie will be:’, name_on_order)

cnx = st.connection(“snowflake”)
session = cnx.session()
my_dataframe = session.table(“smoothies.public.fruit_options”).select(col(‘FRUIT_NAME’))
#st.dataframe(data = my_dataframe, use_container_width=True)

ingredients_list = st.multiselect(‘Select 5 Ingridients:’, my_dataframe,
max_selections =5)

if ingredients_list:
#st.write(ingridients_list)
#st.text(ingridients_list)

ingredients_string = ''

for frutis_choosen in ingredients_list:
    ingredients_string += frutis_choosen+' '

#st.write(ingredients_string)

my_insert_stmt = """ insert into smoothies.public.orders(ingredients,name_on_order)
                values('"""+ingredients_string+"""','"""+name_on_order+"""')"""

#st.write(my_insert_stmt)
#st.stop()

time_to_insert = st.button('Submit Order')

if time_to_insert:
    session.sql(my_insert_stmt).collect()
    st.success('Your Smoothie is ordered, '+name_on_order+' !', icon="✅")

#requirements.txt
snowflake-connector-python
snowflake-snowpark-python
streamlit==1.31.1

Logs:

────────────────────── Traceback (most recent call last) ───────────────────────
/home/adminuser/venv/lib/python3.8/site-packages/streamlit/runtime/scriptrun

ner/script_runner.py:589 in _run_script

/mount/src/melanies_smoothies/streamlit_app.py:3 in
1 #import python
2 import streamlit as st
❱ 3 from snowflake.snowpark.functions import col
4
5 # Write directly to the app
6 st.title(“:cup_with_straw: Customize your smoothies!:cup_with_straw:”)
ModuleNotFoundError: No module named ‘snowflake’

Hi @Manikanta

Looking at the provided output, it seems to be an issue with a dependent library which in this case is snowflake-snowpark-python. It also seems that you have already defined this in the requirements.txt file. Have you tried rebooting the app? Often times, when dependent libraries are modified after an app has been deployed, it may need a reboot to ensure that they are given the chance to install during the booting up phase.

Also check out our FAQ post on the topic:
https://discuss.streamlit.io/t/faq-modulenotfounderror/62347/2

Thanks @dataprofessor for your reply. As you explained, I rebooted many time , but not worked. Because, I saved file name as “requirememts.txt” instead of “requirements.txt”. But, your reply helped me a lot.

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