flyte: [BUG] Flytekit gRPC error: symbol not found in flat namespace '_CFRelease'
Describe the bug
There seems to be an issue with grpc when calling pyflyte run
equilibrium pyflyte run <aws:eq>
Traceback (most recent call last):
File "/Users/bwilliams/miniforge3/envs/flyte/bin/pyflyte", line 5, in <module>
from flytekit.clis.sdk_in_container.pyflyte import main
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/flytekit/__init__.py", line 163, in <module>
from flytekit.core.base_sql_task import SQLTask
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/flytekit/core/base_sql_task.py", line 4, in <module>
from flytekit.core.base_task import PythonTask, TaskMetadata
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/flytekit/core/base_task.py", line 28, in <module>
from flytekit.core.context_manager import ExecutionParameters, FlyteContext, FlyteContextManager, FlyteEntities
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/flytekit/core/context_manager.py", line 30, in <module>
from flytekit.clients import friendly as friendly_client # noqa
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/flytekit/clients/friendly.py", line 18, in <module>
from flytekit.clients.raw import RawSynchronousFlyteClient as _RawSynchronousFlyteClient
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/flytekit/clients/raw.py", line 9, in <module>
import grpc
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: dlopen(/Users/bwilliams/miniforge3/envs/flyte/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_CFRelease'
Expected behavior
This should run the script being invoked
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn’t been raised already?
- Yes
Have you read the Code of Conduct?
- Yes
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (9 by maintainers)
I resolved this by doing:
pip uninstall grpcio conda install grpcio conda install grpcio-tools
This correctly installed the M1 versions. For info, see: https://stackoverflow.com/questions/72620996/apple-m1-symbol-not-found-cfrelease-while-running-python-app
I was using Python 3.9.12 on a Mac Studio running macOS v12.5.1
@bmwilly I found that this error only happened in miniforge3. To work around this error, you could use Anaconda.
I’m still getting the same error, following the same steps as above (grpcio 1.47.0 is being installed).
We are aware of an issue affecting python 3.10 on M1’s, unfortunately the workaround doesn’t seem to work on miniforge (or possibly conda?).
Good news is that the underlying issue is being fixed in the next release of the
grpclibraries. Once those go out we’re going to update flytekit to test on our side ASAP.