Requirements.txt and Snowpark for Python

I am trying to get Snowpark for Python to work in Streamlit Cloud.

I have a requirements.txt file in my repo; DaAnalytics Github (streamline)

For some reason I cannot get it to work. I receive the following error; “Could not find a version that satisfies the requirement snowflake-snowpark-python==0.7.0 (from versions: none)”

Where am I going wrong?

I assume the reason could be, that you have to use Python 3.8

Thanks for the suggestion @Franky1

I am new to Streamlit Cloud, which made that I did not see how to change to Python 3.8. Therefore I created a new app with Python 3.8. Unfortunately it still errors:

[21:26:54] 🖥 Provisioning machine...
[21:27:00] 🎛 Preparing system...
[21:27:06] ⛓ Spinning up manager process...
[21:27:05] 🚀 Starting up repository: 'snowflake', branch: 'master', main module: 'python/streamlit/myFirstSnowpark.py'
[21:27:05] 🐙 Cloning repository...
[21:27:07] 🐙 Cloning into '/app/snowflake'...
[21:27:07] 🐙 Cloned repository!
[21:27:07] 🐙 Pulling code changes from Github...
[21:27:08] 📦 Processing dependencies...
──────────────────────────────────────── pip ───────────────────────────────────────────
Collecting snowflake-connector-python==2.7.8
  Downloading snowflake_connector_python-2.7.8-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.5/16.5 MB 171.5 MB/s eta 0:00:00[2022-06-23 21:27:10.617959] 
ERROR: Could not find a version that satisfies the requirement snowflake-snowpark-python==0.7.0 (from versions: none)
ERROR: No matching distribution found for snowflake-snowpark-python==0.7.0
WARNING: You are using pip version 22.0.3; however, version 22.1.2 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.
Checking if Streamlit is installed
────────────────────────────────────────────────────────────────────────────────────────
[21:27:11] ❗️ installer returned a non-zero exit code
[21:27:11] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

But it pulls a version for python3.9 :thinking:
Just put only this in your requirements.txt file and try again and make sure the runtime is Python 3.8:

snowflake-snowpark-python==0.7.0

Thanks @Franky1

Removing and re-creating the app and only putting snowflake-snowpark-python==0.7.0 in the requirements.txt did the trick.

No I am facing different errors, but I think I know the cause. Otherwise I will create a new ticket.

Thanks again for your support.

Hi,
I am facing the exact same issue with this simple repo GitHub - arnoN7/streamlittest
How can I use Python 3.8. I added a runtime.txt file in my repo with :

[08:07:17] 🖥 Provisioning machine...
[07:56:46] 🚀 Starting up repository: 'streamlittest', branch: 'master', main module: 'main.py'
[07:56:46] 🐙 Cloning repository...
[07:56:47] 🐙 Cloning into '/app/streamlittest'...
[07:56:47] 🐙 Cloned repository!
[07:56:47] 🐙 Pulling code changes from Github...
[07:56:48] 📦 Processing dependencies...
──────────────────────────────────────── pip ───────────────────────────────────────────
ERROR: Could not find a version that satisfies the requirement snowflake-snowpark-python==0.7.0 (from versions: none)
ERROR: No matching distribution found for snowflake-snowpark-python==0.7.0
WARNING: You are using pip version 22.0.3; however, version 22.1.2 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.
Checking if Streamlit is installed
────────────────────────────────────────────────────────────────────────────────────────
[07:56:49] ❗️ installer returned a non-zero exit code
[07:56:49] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

Thx

Arno,

For me the Python version 3.8 and only the snowflake-snowpark-python==0.7.0 in the requirements.txt did the trick.

Daan

Maybe I miss something, but I can you force Python 3.8 being used on Streamlit Cloud?

Yes, during deployment under Advanced you can select the python version of the runtime.
However, this cannot be changed afterwards. Then you have to delete the app and deploy it again.

@Franky1 @daanalytics thx :slight_smile: I missed the option during the app creation.