SNOW-488688: fetch_pandas_all() raises error in pyinstaller executable
Please answer these questions before submitting your issue. Thanks!
-
What version of Python are you using?
Replace with the output of
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] -
What operating system and processor architecture are you using?
Replace with the output of
Windows-10-10.0.19041-SP0 -
What are the component versions in the environment (
pip freeze)?Replace with the output of
snowflake-connector-python==2.6.2, pyinstaller==4.5.1,pandas==1.3.4 -
What did you do?
Created a pyinstaller executable build and used fetch_pandas_all() method which through error in the attached screenshot. But pd.read_sql works fine
-
What did you expect to see?
fetch_pandas_all() to improve the query performance.
- Can you set logging to DEBUG and collect the logs?

The error comes form: https://github.com/snowflakedb/snowflake-connector-python/blob/c9aa4f1f82d71db145ec4a435f5ffc6113f35c34/src/snowflake/connector/cursor.py#L947
I think this is because you didn't include the arrow_iterator.cpython-37m-x86_64-linux-gnu.so in your PyInstaller that gets built when you build snowflake-connector-python.
Our code will fall back to using JSON results when this .so file is missing.
Could you try making sure to include that in your application?
I tried adding arrow_iterator.cp38-win_amd64.pyd file along with arrow.dll and arrow_python.dll in the build using --add-binary flag of pyinstaller, but it still failes. Any ideas over here? Or may be a hook file which will add all the related binaries and data.
I just faced the same issue and I copied all the *py files from site-dist/snowflake/connector into my DIST/snowflake/connector folder and it worked
I'm closing the issue as this is expected be resolved by copying and pasting all the files under site-dist folder to the destination dir.
I just faced the same issue and I copied all the *py files from site-dist/snowflake/connector into my DIST/snowflake/connector folder and it worked
I have this error on Windows. Script runs fine interactively but crashes when complied with pyinstaller. I cannot determine what this 'fix' is. Can somebody be more specific on what files need to be put where?.