TTS: [Bug] Installation in M1 venv fails

Describe the bug

Installing tts in a python venv on macOS fails to install.

To Reproduce

mkdir ~/Desktop/tts
cd ~/Desktop/tts
python3 -m venv .

source ~/Desktop/tts/bin/activate
pip3 install setuptools wheel TTS --upgrade

Expected behavior

Successful installation.

Logs

note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.



### Environment

M1 Mac ARMx64, macOS 12.3.1, Python 3.9.12 (brew)



### Additional context

_No response_

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 27 (3 by maintainers)

Most upvoted comments

At an earlier point I had run this (not sure if it is a requirement):

brew install mecab

This did the trick! Thank you

I’m not sure if this is best solution but this worked for me:

brew install --cask miniforge
conda activate
python --version

You should see:

Python 3.10.6

If you already have miniforge and it is an older version of python, run:

brew reinstall --cask miniforge

Setup the main requirements:

conda install numpy scipy scikit-learn Cython
pip install -e . # not sure if we need this, as make install will do it
make install

Then use it:

mkdir -p ../output/path
tts --text "The alligator mound effigy" --out_path ../output/path/speech.wav

At an earlier point I had run this (not sure if it is a requirement):

brew install mecab

Sure I’ll try that (Just so you know I hate python)

At an earlier point I had run this (not sure if it is a requirement):

brew install mecab

Works for me too! First

brew install mecab

Then

pip install TTS

For me it fails due to “mecab-python3”

See:

Installing collected packages: mecab-python3
  Running setup.py install for mecab-python3: started
  Running setup.py install for mecab-python3: finished with status 'error'

  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      /Users/myuser/.local/share/virtualenvs/ttstest-jyoqz_bN/lib/python3.9/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-12-arm64-cpython-39
      creating build/lib.macosx-12-arm64-cpython-39/MeCab
      copying src/MeCab/__init__.py -> build/lib.macosx-12-arm64-cpython-39/MeCab
      copying src/MeCab/cli.py -> build/lib.macosx-12-arm64-cpython-39/MeCab
      warning: build_py: byte-compiling is disabled, skipping.
      
      running build_ext
      error: [Errno 2] No such file or directory: 'mecab-config'
      [end of output]

We officially only support Linux. Thus I close this issue but feel free to keep the conversation here.

Being said that… One of our deps (mecab) used for G2P in Japanese is not M1 compatible. Try manually installing TTS by removing it from the requirements.

for people needing help for mac m2 using py=3.8 virtual env:

brew install mecab-ko
pip3 install numba
pip3 install TTS

does the trick.

I am having the same issue. Any progress?

Can confirm this doesn’t work on M1. I tried cloning the repo and changing the numpy dependency in requirements.txt to 1.20.3, which seems to be the oldest release that compiles on M1, but that gives an error about llvmlite

RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.

This seems to be a known issue with M1 and the llvmlite and lumba libraries and there are even some experimental wheels to fix it, but i couldn’t get it to work unfortunately.