2

At first I got the error UserWarning: You have an incompatible version of 'pyarrow' installed (7.0.0), please install a version that adheres to: 'pyarrow<6.1.0,>=6.0.0; extra == "pandas"'

Then I followed the advice on snowflake Python Connection KeyError: 'snowflake-connector-python and did the following:

pip install --upgrade --force-reinstall pandas
pip install --upgrade --force-reinstall pyarrow
pip install --upgrade --force-reinstall snowflake-connector-python
pip install --upgrade --force-reinstall sqlalchemy
pip install --upgrade --force-reinstall snowflake-sqlalchemy

But then I got the error UserWarning: You have an incompatible version of 'pyarrow' installed (12.0.0), please install a version that adheres to: 'pyarrow<10.1.0,>=10.0.1; extra == "pandas"'

How can I fix this?

Felipe Hoffa
  • 54,922
  • 16
  • 151
  • 325

2 Answers2

2

An easy way out of this error loop is to install the pyarrow version that the error message is asking for.

For example this solved the warning for me:

pip install pyarrow==10.0.1
Felipe Hoffa
  • 54,922
  • 16
  • 151
  • 325
  • 1
    Sounds so trivial. Also, possible duplicate of https://stackoverflow.com/questions/5226311/installing-specific-package-version-with-pip – berinaniesh May 16 '23 at 04:51
2

The best fix for this is to install the python snowflake connector with the pandas extra - this then correctly restricts the pyarrow package:

https://github.com/snowflakedb/snowflake-connector-python/blob/d78a8da90775f41ac66b7d22952f5777f8ca2dbb/setup.cfg#L97-L99

In general, use:

pip install 'snowflake-connector-python[pandas]'

So for your example, you'd need to:

pip install --upgrade --force-reinstall \
    pandas \
    pyarrow \
    'snowflake-connector-python[pandas]' \
    sqlalchemy \
    snowflake-sqlalchemy

to allow dependency resolution to do its magic.

James Owers
  • 7,948
  • 10
  • 55
  • 71