question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Flytekit gRPC error: symbol not found in flat namespace '_CFRelease'

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
john-wallace-devcommented, Oct 23, 2022

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

1reaction
pingsutwcommented, Jul 26, 2022

@bmwilly I found that this error only happened in miniforge3. To work around this error, you could use Anaconda.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Symbol not found: _CFRelease while running Python app
I am hoping to run my app without any problem, but I got this attached error. Could someone help or ...
Read more >
Error when import grpc: "Symbol not found: _deflate"解决方法
Referenced from: /anaconda3/lib/python3.6/site-packages/grpc/_cython/cygrpc.cpython-36m-darwin.so. Expected in: flat namespace.
Read more >
Symbol not found, Expected in: flat namespace - splunktool
Trying to run freqtrader and getting a weird error that I can't find a solution for - just wondering if you'd have an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found