Skip to content

disable pyfory.format import warning #2475

@chaokunyang

Description

@chaokunyang

Search before asking

  • I had searched in the issues and found no similar issues.

Version

main

Component(s)

Python

Minimal reproduce step

import pyfory

What did you expect to see?

no warning

What did you see instead?

If pyarrow not installed, import pyfory will issue a warning:

>>> import pyfory
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/__init__.py:56: RuntimeWarning: Fory format initialization failed, please ensure pyarrow is installed with version which fory is compiled with: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/_format.so, 0x0002): Library not loaded: '@rpath/libarrow.1500.dylib'
  Referenced from: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/_format.so'
  Reason: tried: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/../../../_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/_format.so.runfiles/fory/_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/../../../_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Upython_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/_format.so.runfiles/fory/_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Upython_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/../../../_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/_format.so.runfiles/fory/_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/../../../_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Upython_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyfory/format/_format.so.runfiles/fory/_solib_darwin_x86_64/_U@local_Uconfig_Upyarrow_S_S_Carrow_Upython_Ushared_Ulibrary___Uexternal_Slocal_Uconfig_Upyarrow/libarrow.1500.dylib' (no such file), '/usr/lib/libarrow.1500.dylib' (no such file)
  from pyfory.format import *  # noqa: F401,F403 # pylint: disable=unused-import

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions