r9y9/pyopenjtalk

Fail to import pyopenjtalk on M1 platform

sophiefy opened this issue · 1 comments

I was trying to import pyopenjtalk but I got this error.

File ~/anaconda3/lib/python3.10/site-packages/pyopenjtalk/__init__.py:20
     17 except ImportError:
     18     raise ImportError("BUG: version.py doesn't exist. Please file a bug report.")
---> 20 from .htsengine import HTSEngine
     21 from .openjtalk import OpenJTalk
     22 from .utils import merge_njd_marine_features

ImportError: dlopen(/Users/hurui05/anaconda3/lib/python3.10/site-packages/pyopenjtalk/htsengine.cpython-310-darwin.so, 0x0002): tried: '/Users/hurui05/anaconda3/lib/python3.10/site-packages/pyopenjtalk/htsengine.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/hurui05/anaconda3/lib/python3.10/site-packages/pyopenjtalk/htsengine.cpython-310-darwin.so' (no such file), '/Users/hurui05/anaconda3/lib/python3.10/site-packages/pyopenjtalk/htsengine.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Any advice would be appreciated!

Solved.

pip uninstall pyopenjtalk[marine]

ARCHFLAGS="-arch arm64" pip install pyopenjtalk[marine] --compile --no-cache-dir