r9y9 / pyopenjtalk

Python wrapper for OpenJTalk
https://r9y9.github.io/pyopenjtalk/
Other
203 stars 69 forks source link

Fail to import pyopenjtalk on M1 platform #54

Closed sophiefy closed 1 year ago

sophiefy commented 1 year ago

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!

sophiefy commented 1 year ago

Solved.

pip uninstall pyopenjtalk[marine]

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