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

pip install mediapipe not working on apple silicon Macs, even in anaconda environment #2120

Closed
nakshatrasinghh opened this issue Jun 3, 2021 · 24 comments
Assignees
Labels
platform:python MediaPipe Python issues type:build/install For Build and Installation issues

Comments

@nakshatrasinghh
Copy link

nakshatrasinghh commented Jun 3, 2021

Screenshot 2021-06-03 at 7 39 17 PM

@kiranscaria
Copy link

kiranscaria commented Jun 3, 2021

What is the pip and python version?

@tviktar
Copy link

tviktar commented Jun 4, 2021

Same issue.
Pip version: 21.1.2
Python: 3.8.6

@nakshatrasinghh
Copy link
Author

Same issue.
Pip version: 21.1.2
Python: 3.8.6

Same versions on my machine as well. Any ways to solve this issue?

@sgowroji sgowroji self-assigned this Jun 7, 2021
@sgowroji
Copy link

sgowroji commented Jun 7, 2021

Hi @nakshatrasinghh , Can you check this [reference](MediaPipe PyPI supports macOS 10.15 and above. See https://github.com/google/mediapipe/blob/master/docs/getting_started/troubleshooting.md#python-pip-install-failure.).

@sgowroji sgowroji added platform:python MediaPipe Python issues stat:awaiting response Waiting for user response type:build/install For Build and Installation issues labels Jun 7, 2021
@sn1c3
Copy link

sn1c3 commented Jun 8, 2021

Did you try it with python 3.7? I myself got some issues on my macbook (11.2.2). After I changed the conda python env to 3.7 everything worked fine

@nakshatrasinghh
Copy link
Author

nakshatrasinghh commented Jun 8, 2021

Did you try it with python 3.7? I myself got some issues on my macbook (11.2.2). After I changed the conda python env to 3.7 everything worked fine

Doesn't work, I am using M1 silicon not intel

Screenshot 2021-06-08 at 1 53 25 PM

Screenshot 2021-06-08 at 1 54 04 PM

@lucasmsantini
Copy link

Same issue here
image
Python: 3.9.2
PyCharm Community Edition 2021.1.1
PIP: 21.1.2

@sgowroji sgowroji assigned jiuqiant and unassigned sgowroji Jun 9, 2021
@sgowroji sgowroji added stat:awaiting googler Waiting for Google Engineer's Response and removed stat:awaiting response Waiting for user response labels Jun 9, 2021
@jiuqiant
Copy link
Contributor

jiuqiant commented Jun 9, 2021

MediaPipe currently doesn't support arm macOS. So does Mediapipe Python package.

@sgowroji sgowroji removed the stat:awaiting googler Waiting for Google Engineer's Response label Jun 10, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@josiahsrc
Copy link

josiahsrc commented Aug 8, 2021

I did some digging into this and went so far as to attempt to build a wheel for arm64, but to no avail. The only workaround I could find was to instead use rosetta. Here are the steps I took, which may be of help to others facing m1 issues:

  1. Write your terminal application from within finder, select get info, and enable `open using rosetta'
  2. Open up your terminal application with the rosetta flag set
  3. Create a virtual env in your project, python3 -m venv myvenv
  4. Activate it, source ./myvenv/bin/activate
  5. pip install --upgrade pip
  6. pip install mediapipe

After this, I was able to run mediapipe on my Mac. I hope this helps, and good luck!

@sgowroji
Copy link

sgowroji commented Aug 9, 2021

Hi @josiahsrc, Thank you so much for sharing your answer this will definitely help full to the community. Thanks!

@belelaritra
Copy link

belelaritra commented Aug 31, 2021

Yes @josiahsrc after this process it installed successfully into my machine but it's not working. Showing wrong architecture.

@josiahsrc
Copy link

josiahsrc commented Aug 31, 2021

@belelaritra Make sure you're using a python3.8.* version installed with x86_64 architecture. I was able to do this by installing Homebrew for x86_64 architecture (see this post). Then, I installed python 3.8.* using arch -x86_64 brew install python@3.8. From there, I ran the steps in my post above using the newly installed python. E.g.

arch -x86_64 /usr/local/Homebrew/Cellar/python@3.8/3.8.11/bin/python3 -m venv myenv

@belelaritra
Copy link

here homebrew is installed inside opt folder.

@josiahsrc
Copy link

On m1 macs, its typical to have two versions of Homebrew installed. One will be in opt folder (Homebrew for ARM), the other in /usr/local (Homebrew for x86_64)

@belelaritra
Copy link

I have followed all the steps from the link you have provided but there is no Celler folder inside homebrew but it's inside local only.

@josiahsrc
Copy link

Did you follow the second post? It looks like the accepted one is a bit outdated. Make sure you use the x86_64 homebrew via arch -x86_64 /usr/local/homebrew/bin/brew install python@3.8. Apologies, I had forgotten that the ARM homebrew is usually default in PATH.

@belelaritra
Copy link

belelaritra commented Aug 31, 2021

Sorry I followed the first one.
But then I followed your steps (just changed the command into arch -x86_64 /usr/local/Cellar/python@3.8/3.8.11/bin/python3 -m venv myenv ) and it's now working(just checked one hand module).

Thank you sir.
It helps me a lot.

@josiahsrc
Copy link

Happy to help! 😄

@Leon-Brant
Copy link

MediaPipe 目前不支持 arm macOS。Mediapipe Python 包也是如此。
I see. Thank you 🙏 for sharing this information

@yasserdzx
Copy link

it doesnt work on python 3.10 i downgraded mine to 3.9 and it worked

@MatusGasparik
Copy link

Hi @jiuqiant. Can I ask what the plans are regarding the support for the osx-arm64 platform?

@matanox
Copy link

matanox commented Mar 18, 2022

Is the issue only with TensorFlow, or does anything else in mediapipe or which mediapipe depends play as a blocker in using (or building) mediapipe on the M1 processor on mac?

@iPHOENIX-matrix
Copy link

  1. Create a new conda environment and install python version 3.9.13 in that environment
  2. Then using pip install MediaPipe:
    Code:
    pip install mediapipe

Write this code in the terminal.
MediaPipe package will be installed.

I tried to install "mediapipe-silicon" in my M1 Pro MacBook but version error was coming every time with most versions of python but luckily I found the above solution and it worked. Hopefully this might work for other developers.

Happy Coding!
-iPHOENIX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:python MediaPipe Python issues type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests