Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Installation in M1 venv fails #1533

Closed
dawiinci opened this issue Apr 24, 2022 · 28 comments
Closed

[Bug] Installation in M1 venv fails #1533

dawiinci opened this issue Apr 24, 2022 · 28 comments
Labels
bug Something isn't working

Comments

@dawiinci
Copy link

dawiinci commented Apr 24, 2022

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_
@dawiinci dawiinci added the bug Something isn't working label Apr 24, 2022
@vndee
Copy link

vndee commented Apr 25, 2022

Hi @dawiinci, did you solve this? I come with the same problem.

@dawiinci
Copy link
Author

No, unfortunately not.

@p0p4k
Copy link
Contributor

p0p4k commented Apr 25, 2022

Hello, @vndee @dawiinci .
Could you try with numpy=1.21.5 or numpy=1.21.6 and report back? Thanks.

@dawiinci
Copy link
Author

dawiinci commented Apr 26, 2022

I installed both versions without errors. But TTS still fails to install:

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.

@p0p4k
Copy link
Contributor

p0p4k commented Apr 27, 2022

@dawiinci you are re-installing numpy from TTS's requirements.txt . Can you clone the repo, replace "numpy=XXX" to "numpy=1.21.5" or "numpy=1.21.6" in the requirements.txt and then install ? Thanks.

@mikejgray
Copy link

FWIW, this fails for me too, even replacing the numpy version with 1.21.5 or 1.21.6. It looks like there are many bugs in numpy on an M1 chip based on their issues upstream.

@dawiinci
Copy link
Author

Are you on an M1 Mac as well?

@mikejgray
Copy link

I am on an M1.

@hay
Copy link

hay commented May 2, 2022

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.

@ghost
Copy link

ghost commented May 31, 2022

I am having the same issue. Any progress?

@erogol erogol changed the title [Bug] Installation in venv fails [Bug] Installation in M1 venv fails Jun 1, 2022
@nihiluis
Copy link

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]

@jacksongoode
Copy link

Having the same issue 👀

@erogol
Copy link
Member

erogol commented Jul 11, 2022

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.

@erogol erogol closed this as completed Jul 11, 2022
@ghost
Copy link

ghost commented Jul 11, 2022

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

@melMass
Copy link

melMass commented Aug 13, 2022

This works thanks, pyworld has no wheel but builds fine on M1

@ghost
Copy link

ghost commented Aug 13, 2022

We can probably also run it in Docker.

@jeffrafter
Copy link

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

@hay
Copy link

hay commented Nov 14, 2022

@h57758 i tried running the code in Docker on my M1 but unfortunately without success.

Steps to reproduce:

  1. Checkout the code
  2. Run docker build -t tts .
  3. Run docker run tts --text "hello"

I'm getting this error:

/venv/lib/python3.8/site-packages/torchaudio/compliance/kaldi.py:22: UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version of numpy is 0xe (Triggered internally at /root/pytorch/torch/csrc/utils/tensor_numpy.cpp:77.)
  EPSILON = torch.tensor(torch.finfo(torch.float).eps)
Traceback (most recent call last):
  File "/venv/bin/tts", line 8, in <module>
    sys.exit(main())
  File "/root/TTS/bin/synthesize.py", line 357, in main
    wav = synthesizer.tts(
  File "/root/TTS/utils/synthesizer.py", line 270, in tts
    outputs = synthesis(
  File "/root/TTS/tts/utils/synthesis.py", line 217, in synthesis
    model_outputs = model_outputs[0].data.cpu().numpy()
RuntimeError: Numpy is not available

So this seems to be the same numpy problem mentioned before.

@pi43r
Copy link

pi43r commented Dec 6, 2022

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

brew install mecab

This did the trick! Thank you

@hay
Copy link

hay commented Dec 7, 2022

I'm not sure what happened, but when i pull from the latest version (c753ad4) the demo runs fine using Docker on my M1.

@virtualmartire
Copy link

virtualmartire commented Apr 8, 2023

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

@howardbaek
Copy link

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 can also confirm that brew install mecab did the trick on an Apple M2 Chip!

@TheAlphamerc
Copy link

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 can also confirm that brew install mecab did the trick on an Apple M2 Chip!

Thanks @jeffrafter, it did works on the Apple M1 chip.

@dnabanita7
Copy link

dnabanita7 commented Jul 9, 2023

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.

@iampedroalz
Copy link

Thanks @jeffrafter, it works on the M2 chip also!

@jiangcheng1214
Copy link

Still getting this error with Python 3.11.1 even with brew install mecab, I'm on M1

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

@JauJau088
Copy link

Still getting this error with Python 3.11.1 even with brew install mecab, I'm on M1

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

I am using M1 and pip TTS and here's what I did:

  • Install and activate miniforge conda like mentioned above brew install --cask miniforge
  • Leave that installation as it is, do not add anything else
  • Install mecab and espeak (needed for certain models) brew install mecab, brew install espeak

And that's it.

@winefox
Copy link

winefox commented Apr 26, 2024

brew install mecab
this works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests