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

M1 wheels are not available #84

Closed
polm opened this issue Aug 21, 2022 · 21 comments
Closed

M1 wheels are not available #84

polm opened this issue Aug 21, 2022 · 21 comments
Labels
osx Mac OSX specific issues

Comments

@polm
Copy link
Collaborator

polm commented Aug 21, 2022

There are no wheels for the OSX M1 / arm64 architecture. They are not available because I do not have a way to automate builds.

Please see polm/fugashi#55 (comment) for more details and progress updates.

Note that in the meantime you have two options:

  1. Build MeCab from source before installing mecab-python3. I believe this should just work, and it's straightforward if you're familiar with autotools builds. (It should also work if you install with brew install mecab first.)
  2. Use x86_64 Python on the M1. I believe this is less efficient, but it may be easier in some cases.
@polm polm pinned this issue Aug 21, 2022
@polm polm added the osx Mac OSX specific issues label Aug 21, 2022
@gokalper
Copy link

gokalper commented Sep 4, 2022

Leaving this incase anyone else can benefit:

I was able to compile it myself using the following on an M1 Mac:

pip3 download mecab-python3
tar xfv mecab-python3-1.0.5.tar.gz
cd mecab-python3-1.0.5    
brew install mecab
python3 setup.py build
python3 setup.py install
pip3 list

@amitkot
Copy link

amitkot commented Sep 28, 2022

For me this was the missing part:

brew install mecab

@polm
Copy link
Collaborator Author

polm commented Sep 28, 2022

I'm not familiar with the brew distribution of MeCab, but that is one way to install it instead of building directly from source. If you use their version you should check if they've patched it in any way.

@agilebean

This comment was marked as off-topic.

@polm

This comment was marked as resolved.

@agilebean

This comment was marked as off-topic.

@agilebean

This comment was marked as off-topic.

@polm

This comment was marked as resolved.

@agilebean

This comment was marked as resolved.

@polm

This comment was marked as resolved.

@polm
Copy link
Collaborator Author

polm commented Dec 13, 2022

Looking over this again, it just occurred to me that I should clearly state I expect this should work:

brew install mecab
pip install mecab-python3

I don't have a Mac to check this, but you shouldn't have to do the pip download and other steps - pip will install from source by default if it can't find a wheel. (I guess this is what @amitkot was saying upthread.)

@agilebean
Copy link

agilebean commented Dec 14, 2022

@polm Yes you're right.
However, on Apple Silicon, you need to force both commands to compile from source, as mentioned here

/opt/homebrew/bin/brew install mecab --build-from-source

ARCHFLAGS='-arch arm64' pip install --compile --use-pep517 --no-cache-dir --force" mecab-python3==1.0.5

@BenQuigley
Copy link

BenQuigley commented Jan 11, 2023

@agilebean just a small correction, there is a misplaced double quote in your command; I think it should be

/opt/homebrew/bin/brew install mecab --build-from-source
pip install unidic-lite  # in case someone missed it from the README
ARCHFLAGS='-arch arm64' pip install --compile --use-pep517 --no-cache-dir --force mecab-python3==1.0.5

@yin-ori
Copy link

yin-ori commented May 20, 2023

@BenQuigley this will run me into an error:

ARCHFLAGS='-arch arm64' pip install --compile --use-pep517 --no-cache-dir --force mecab-python3==1.0.5
Collecting mecab-python3==1.0.5
  Downloading mecab-python3-1.0.5.tar.gz (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.6/77.6 kB 884.4 kB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Collecting setuptools>=40.8.0
        Using cached setuptools-67.8.0-py3-none-any.whl (1.1 MB)
      Collecting wheel
        Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
      Installing collected packages: wheel, setuptools
      ERROR: Cannot set --home and --prefix together
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

@ariqRam
Copy link

ariqRam commented Jun 3, 2023

tar xfv mecab-python3-1.0.5.tar.gz

Worked for my M1!

@yin-ori
Copy link

yin-ori commented Jun 19, 2023

yes, I needed to install and not build from scratch, then it worked for me too :-)

@polm
Copy link
Collaborator Author

polm commented Aug 25, 2023

This should be resolved in fugashi thanks to polm/fugashi#80. I have just made a release there, and if that goes smoothly I will port the M1 build over here eventually.

@polm
Copy link
Collaborator Author

polm commented Sep 15, 2023

I have made an alpha release that includes what I think are working M1 wheels. You can install it like so:

pip install mecab-python3==1.0.8a1

If I can get some confirmation that this works I will make a release.

@cadazar
Copy link

cadazar commented Sep 21, 2023

@polm Just tried installing on M2 using Python 3.11 and it works great!

@polm
Copy link
Collaborator Author

polm commented Sep 22, 2023

Thank you for the confirmation, I have made a 1.0.8 release with the wheels, which should be available shortly.

@polm polm closed this as completed Sep 23, 2023
@polm
Copy link
Collaborator Author

polm commented Sep 23, 2023

This has been released. Thanks to everyone who provided advice to users inconvenienced by this issue.

@polm polm unpinned this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
osx Mac OSX specific issues
Projects
None yet
Development

No branches or pull requests

8 participants