snowflake-connector-python icon indicating copy to clipboard operation
snowflake-connector-python copied to clipboard

SNOW-488688: fetch_pandas_all() raises error in pyinstaller executable

Open chetansurwade opened this issue 5 years ago • 5 comments

Please answer these questions before submitting your issue. Thanks!

  1. 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)]

  2. What operating system and processor architecture are you using?

    Replace with the output of Windows-10-10.0.19041-SP0

  3. 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

  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

  5. What did you expect to see?

fetch_pandas_all() to improve the query performance.

  1. Can you set logging to DEBUG and collect the logs? image

chetansurwade avatar Oct 19 '21 15:10 chetansurwade

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?

sfc-gh-mkeller avatar Oct 28 '21 20:10 sfc-gh-mkeller

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.

chetansurwade avatar Oct 29 '21 12:10 chetansurwade

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

lilian-arnaud avatar Dec 21 '22 11:12 lilian-arnaud

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.

sfc-gh-aling avatar Mar 18 '23 01:03 sfc-gh-aling

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?.

rob-dumoulin avatar Aug 13 '24 01:08 rob-dumoulin