Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mediapipe Import Error on macOS 11 #5836

Open
GrillingUXO opened this issue Jan 22, 2025 · 3 comments
Open

Mediapipe Import Error on macOS 11 #5836

GrillingUXO opened this issue Jan 22, 2025 · 3 comments
Assignees
Labels
os:macOS Issues on MacOS platform:python MediaPipe Python issues stat:awaiting response Waiting for user response type:build/install For Build and Installation issues

Comments

@GrillingUXO
Copy link

GrillingUXO commented Jan 22, 2025

I encountered an ImportError when running a Python script that uses Mediapipe on macOS 11.7. The issue appears to be related to compatibility between Mediapipe's native bindings and the system's libraries (libc++).

OS Platform and Distribution

macOS 11.7.10 BIg Sur

Compiler version

No response

Programming Language and version

Python 3.9.7

Installed using virtualenv? pip? Conda?(if python)

pip

MediaPipe version

0.10.5

Bazel version

No response

XCode and Tulsi versions (if iOS)

No response

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

4.10.0.84

Describe the problem

A bug happened!

Complete Logs

Traceback (most recent call last):
  File "/Users/ng/Downloads/program.py", line 10, in <module>
    import mediapipe as mp
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mediapipe/__init__.py", line 15, in <module>
    from mediapipe.python import *
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mediapipe/python/__init__.py", line 17, in <module>
    from mediapipe.python._framework_bindings import resource_util
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mediapipe/python/_framework_bindings.cpython-39-darwin.so, 2): Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mediapipe/python/_framework_bindings.cpython-39-darwin.so (which was built for Mac OS X 13.0)
  Expected in: /usr/lib/libc++.1.dylib
@GrillingUXO GrillingUXO added the type:build/install For Build and Installation issues label Jan 22, 2025
@kuaashish kuaashish assigned kuaashish and unassigned kalyan2789g Jan 23, 2025
@kuaashish kuaashish added os:macOS Issues on MacOS platform:python MediaPipe Python issues labels Jan 23, 2025
@kuaashish
Copy link
Collaborator

Hi @GrillingUXO,

Could you try running the following command?

pip install msvc-runtime

Additionally, you can refer to this similar issue: #1839 for potential solutions.

If the issue persists, please let us know whether your macOS is Intel-based or Silicon-based, along with the complete steps to reproduce the issue. This will help us investigate further.

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Jan 23, 2025
@GrillingUXO
Copy link
Author

pip install msvc-runtime

Hi @GrillingUXO,

Could you try running the following command?

pip install msvc-runtime

Additionally, you can refer to this similar issue: #1839 for potential solutions.

If the issue persists, please let us know whether your macOS is Intel-based or Silicon-based, along with the complete steps to reproduce the issue. This will help us investigate further.

Thank you!!

Thanks for your reply, but it seems like the msvc-runtime package is not available on PyPI,

\u@wfng \w$ pip3 install msvc-runtime
ERROR: Could not find a version that satisfies the requirement msvc-runtime (from versions: none)
ERROR: No matching distribution found for msvc-runtime

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Jan 24, 2025
@kuaashish
Copy link
Collaborator

Hi @GrillingUXO,

There is a known issue with installing MediaPipe in a virtual environment. Could you try installing it outside of the virtual environment and let us know if the installation is successful?

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:macOS Issues on MacOS platform:python MediaPipe Python issues stat:awaiting response Waiting for user response type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests

3 participants