Why am I getting an error when using the snowflake.connector package for Python?

This topic was automatically generated from Slack. You can find the original thread here.

Hello Guys,
When I use the snowflake.connector package for python I get this error:

'Error
Command failed: python3 -m pip install --target=/tmp/__pdg__/dist/python -r requirements.txt --upgrade WARNING: The directory '/home/sbx_user1051/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. ERROR: Ignored the following versions that require a different python version: 0.3.0 Requires-Python 3.11,=3.8; 0.6.0 Requires-Python 3
.12,=3.8 ERROR: Could not find a version that satisfies the requirement snowflake==0.6.0 (from versions: 0.0.2, 0.0.3, 0.0.4, 0.4.0, 0.5.0, 0.5.1) ERROR: No matching distribution found for snowflake==0.6.0 [notice] A new release of pip is available: 23.2.1 -> 24.0 [notice] To update, run: pip install --upgrade pip'.

Everything was working just fine until very recently.
Could anyone please help me with this ?

Hi , not sure if you’re using the snowflake or snowflake-connector package but when the PyPI package name is different from the import name you need to add magic comment

Let me know if this helps

I already tried to import it using:

# pipedream add-package snowflake-connector-python
import snowflake.connector as snowflake

I get this error after:

Error
Command failed: python3 -m pip install --target=/tmp/__pdg__/dist/python -r requirements.txt --upgrade WARNING: The directory '/home/sbx_user1051/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. ERROR: Ignored the following versions that require a different python version: 0.3.0 Requires-Python <3.11,>=3.8; 0.6.0 Requires-Python <3.12,>=3.8 ERROR: Could not find a version that satisfies the requirement snowflake==0.6.0 (from versions: 0.0.2, 0.0.3, 0.0.4, 0.4.0, 0.5.0, 0.5.1) ERROR: No matching distribution found for snowflake==0.6.0 [notice] A new release of pip is available: 23.2.1 -> 24.0 [notice] To update, run: pip install --upgrade pip

When trying to import snowflake only:

# pipedream add-package snowflake
import snowflake.connector as snowflake

I gte this error:

No module named 'snowflake.connector'; 'snowflake' is not a package

Can you try pinning the package version?

When pinning the version I get exactly the same error.
It seems that the working python version is not recent enough to work with the last snowflake version.

Interesting, do you know what version does snowflake require?

Python < 3.12, >=3.8 (cf doc)

Oh interesting, we recently updated Python to version 3.12

But it only supports previous versions

Not sure to understand what you mean here.
What do you suggest I do to fix my issue with snowflake (as you tell me the python version is ok) ?

I mean the current Python version that runs in Pipedream is 3.12

But the snowflake package supports only < 3.12

Are you comfortable using alternatives like Node.js or our integrations?

E.g. https://pipedream.com/apps/snowflake

Oh right I see.
How can we bypass this ?
Not that much sorry, we’d rather keep an integrity in our devs and keep all in python. Your integrations are not sophisticated enough for our use.

Do you see any way of forcing to run python with an older version ?

Hmm there could be a possibility but I’m not sure

Could you share your Workspace ID or name