I have tried to install fugashi
on Mac M1 (Ventura)
with pyenv
pip install fugashi
Collecting fugashi
Using cached fugashi-1.2.1-cp311-cp311-macosx_13_0_arm64.whl
Installing collected packages: fugashi
Successfully installed fugashi-1.2.1
to me that looks like the arm64 version was correctly used. However, when I try to run this script in python
from fugashi import Tagger
tagger = Tagger('-Owakati')
text = "麩菓子は、麩を主材料とした日本の菓子。"
tagger.parse(text)
for word in tagger(text):
print(word, word.feature.lemma, word.pos, sep='\t')
it says
dlopen(/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so, 0x0002): tried: '/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so' (no such file), '/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
File "/Users/mypc/Git/Research/Python/languageprocessing/fugashiparser.py", line 1, in <module>
from fugashi import Tagger
ImportError: dlopen(/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so, 0x0002): tried: '/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so' (no such file), '/Users/mypc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/fugashi/fugashi.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
so I tried to follow another guide that recommended building from source:
ARCHFLAGS='-arch arm64' pip install --compile --use-pep517 --no-cache-dir --force fugashi
however when I run that it says my pip is outdated, even when I upgrade.
[notice] A new release of pip is available: 23.0.1 -> 23.1
[notice] To update, run: pip install --upgrade pip
notice that this only happens if I build from source, otherwise pip is not indicating issues AND pip --version
gives the correct 23.1
that bugs me a bit, as I used to have an error like that before and after weeks found out, that in a pip.conf there was a wrong path in place (it was none of the bashrc or zshrc files), but now I am using pyenv and I don't find any pip.conf files to check. since it only happens when I install from source I assume there is an incompatibility of paths with the pip thats used for that?
if I install normally with pip, other packages work fine and pip will not request an update (and is already updated to the newest version)
I have tried these 2 but they also dont have a solution for me: 1 2 there it was also suggested its an error with pyenv "This will not be answer to your question/specific situation (most probably), but I got this issue when using python built for pyenv/virtualenv, and rm -rf ~/.pyenv helped me. So, python was reinstalled (properly this time; reinstalled by other scripts in our CI, because I deleted installation), and it's built for x86 and works fine on arm."