BYVoid / OpenCC

Conversion between Traditional and Simplified Chinese
https://opencc.byvoid.com/
Apache License 2.0
8.3k stars 974 forks source link

OSError on import opencc #784

Open danushk97 opened 1 year ago

danushk97 commented 1 year ago

Getting OSError on import opencc.

Environment details: OS: MacOS Ventura 13.3.1 Python 3.10.9

import opencc Traceback (most recent call last): File "", line 1, in File "/Users/danush/anaconda3/envs/test_env/lib/python3.10/site-packages/opencc.py", line 24, in libopencc = CDLL('libopencc.so.1', use_errno=True) File "/Users/danush/anaconda3/envs/test_env/lib/python3.10/ctypes/init.py", line 374, in init self._handle = _dlopen(self._name, mode) OSError: dlopen(libopencc.so.1, 0x0006): tried: 'libopencc.so.1' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibopencc.so.1' (no such file), '/Users/danush/anaconda3/envs/test_env/lib/libopencc.so.1' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/danush/anaconda3/envs/test_env/lib/libopencc.so.1' (no such file), '/Users/danush/anaconda3/envs/test_env/lib/libopencc.so.1' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/danush/anaconda3/envs/test_env/lib/libopencc.so.1' (no such file), '/Users/danush/anaconda3/envs/test_env/lib/python3.10/lib-dynload/../../libopencc.so.1' (no such file), '/Users/danush/anaconda3/envs/test_env/lib/libopencc.so.1' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/danush/anaconda3/envs/test_env/lib/libopencc.so.1' (no such file), '/Users/danush/anaconda3/envs/test_env/bin/../lib/libopencc.so.1' (no such file), '/usr/lib/libopencc.so.1' (no such file, not in dyld cache), 'libopencc.so.1' (no such file), '/usr/local/lib/libopencc.so.1' (no such file), '/usr/lib/libopencc.so.1' (no such file, not in dyld cache)

yellowgraysu commented 10 months ago

Look similar to the issue https://github.com/BYVoid/OpenCC/issues/759

If you using Python, you can try the pure Python version to support the macOS M1(Apple Silicon) https://github.com/yichen0831/opencc-python