STT icon indicating copy to clipboard operation
STT copied to clipboard

Bug: ImportError on Mac ARM (Apple Silicon M1)

Open prism0x opened this issue 3 years ago • 0 comments

Describe the bug

Trying to import STT on Mac ARM gives the following error:

Python 3.10.2 (main, Apr 20 2022, 11:04:53) [Clang 13.1.6 (clang-1316.0.21.2.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import stt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/prism0x/.pyenv/versions/3.10.2/lib/python3.10/site-packages/stt/__init__.py", line 23, in <module>
    from stt.impl import Version as version
  File "/Users/prism0x/.pyenv/versions/3.10.2/lib/python3.10/site-packages/stt/impl.py", line 13, in <module>
    from . import _impl
ImportError: dlopen(/Users/prism0x/.pyenv/versions/3.10.2/lib/python3.10/site-packages/stt/_impl.cpython-310-darwin.so, 0x0002): tried: '/Users/prism0x/.pyenv/versions/3.10.2/lib/python3.10/site-packages/stt/_impl.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

I have previously installed Python 3.10.2 using pyenv, because there were no STT PyPI package available for M1 for Python 3.9.

To Reproduce Steps to reproduce the behavior:

$ brew install pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init --path)"\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc
$ pyenv install 3.10.2
$ reset
$ pyenv global 3.10.2

Then restart the shell, install STT and try to import it

$ pip3 install stt
$ python
>>> import stt

Expected behavior

I get the following error as mentioned above:

ImportError: dlopen(/Users/prism0x/.pyenv/versions/3.10.2/lib/python3.10/site-packages/stt/_impl.cpython-310-darwin.so, 0x0002): tried: '/Users/prism0x/.pyenv/versions/3.10.2/lib/python3.10/site-packages/stt/_impl.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

Environment (please complete the following information):

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Monterey 12.3.1 (21E258)
  • TensorFlow installed from (our builds, or upstream TensorFlow):
  • TensorFlow version (use command below):
  • Python version: 3.10.2
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

Additional context N/A

prism0x avatar Apr 20 '22 09:04 prism0x