TTS icon indicating copy to clipboard operation
TTS copied to clipboard

[Bug] unable to install tts on mac m1

Open kundanshrivastava opened this issue 2 years ago β€’ 10 comments

Describe the bug

when i close repo and run command make install it throws error and Failed building wheel for mecab-python3

To Reproduce

  1. close the repo
  2. run the command "make install"

Expected behavior

it should successfully install all packages and the service is accessible through command line

Logs

ERROR: Command errored out with exit status 1:
   command: /Users/kundanshrivastava/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/57/p20g78bs5tv__bdbhbtm7glh0000gn/T/pip-install-fd6dkpg9/mecab-python3_f34232987540474c840fbe831b795cdc/setup.py'"'"'; __file__='"'"'/private/var/folders/57/p20g78bs5tv__bdbhbtm7glh0000gn/T/pip-install-fd6dkpg9/mecab-python3_f34232987540474c840fbe831b795cdc/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/57/p20g78bs5tv__bdbhbtm7glh0000gn/T/pip-wheel-u3gs_1w3
       cwd: /private/var/folders/57/p20g78bs5tv__bdbhbtm7glh0000gn/T/pip-install-fd6dkpg9/mecab-python3_f34232987540474c840fbe831b795cdc/
  Complete output (12 lines):
  /Users/kundanshrivastava/miniconda3/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-11.1-arm64-3.9
  creating build/lib.macosx-11.1-arm64-3.9/MeCab
  copying src/MeCab/__init__.py -> build/lib.macosx-11.1-arm64-3.9/MeCab
  copying src/MeCab/cli.py -> build/lib.macosx-11.1-arm64-3.9/MeCab
  running build_ext
  error: [Errno 2] No such file or directory: 'mecab-config'
  ----------------------------------------
  ERROR: Failed building wheel for mecab-python3

Environment

{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": null
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "1.12.1",
        "TTS": "0.8.0",
        "numpy": "1.21.6"
    },
    "System": {
        "OS": "Darwin",
        "architecture": [
            "64bit",
            ""
        ],
        "processor": "arm",
        "python": "3.9.12",
        "version": "Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000"
    }
}

Additional context

No response

kundanshrivastava avatar Oct 06 '22 06:10 kundanshrivastava

We don't support M1 systems as we stated in the README.md, we support linux ATM. But can you check whether it installs when you remove mecab-python3 from requirements.txt

If it works maybe we can ignore it when installing on M1

erogol avatar Oct 10 '22 09:10 erogol

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

stale[bot] avatar Nov 09 '22 10:11 stale[bot]

See also https://github.com/coqui-ai/TTS/issues/1533#issuecomment-1313159949

jeffrafter avatar Nov 14 '22 06:11 jeffrafter

@erogol following your suggestion to remove mecab-python3 from requirements.txt, this throws the error mecab not found:

tts --text "Text for TTS" --out_path output/path/speech.wav

I understand this is because the default models include mecab but how can we make it run then?

agilebean avatar Dec 13 '22 03:12 agilebean

@kundanshrivastava I was able to make the whole installation work with the following:

# install arm64 dependency before installing mecab-python3
arch -arm64e /opt/homebrew/bin/brew install mecab

# install dependency python
mamba install python=3.10

Nevertheless, there is a new issue that I filed as bug.

agilebean avatar Dec 13 '22 08:12 agilebean

Hey, I'm the mecab-python3 maintainer. I am unable to provide M1 wheels because mecab-python3 needs to compile native extensions and I have no M1 hardware and Github Actions doesn't provide a build env I can use.

I don't really know anything about this package, but it seems like it's not focused on Japanese. If most of your users don't need MeCab, it would be best if you configure it as an extra dependency instead of including it by default, so that users who don't need it to just ignore it.

If you need a reference for how to lazy-load a module and warn about it, look at how spaCy handles Japanese imports.

polm avatar Dec 13 '22 12:12 polm

Hey, I'm the mecab-python3 maintainer. I am unable to provide M1 wheels because mecab-python3 needs to compile native extensions and I have no M1 hardware and Github Actions doesn't provide a build env I can use.

I don't really know anything about this package, but it seems like it's not focused on Japanese. If most of your users don't need MeCab, it would be best if you configure it as an extra dependency instead of including it by default, so that users who don't need it to just ignore it.

@kundanshrivastava @erogol I totally agree with @polm, I think it would be better for most users do remove the MeCab dependency from the default models. Do you think that is possible to implement in the near future?

agilebean avatar Dec 14 '22 14:12 agilebean

In due time yes but probably not in the near future.

erogol avatar Jan 04 '23 02:01 erogol

I was able to install it using brew mecab.

evilc3 avatar Jan 20 '23 12:01 evilc3

You can also now run the Docker container on latest Docker Desktop (4.16+) with Rosetta for x86/amd64 emulation enabled (disable containerd for pulling images):

docker run --rm -it -p 5002:5002 --platform linux/amd64 --entrypoint /bin/bash ghcr.io/coqui-ai/tts-cpu

MaxHorstmann avatar Feb 18 '23 03:02 MaxHorstmann

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

stale[bot] avatar Mar 22 '23 19:03 stale[bot]

on M2 mac and with conda I was able to install TTS dev branch.

erogol avatar Mar 23 '23 11:03 erogol

on M2 mac and with conda I was able to install TTS dev branch.

Can you explain more? What did you do to install that branch with conda?

fivestones avatar Mar 29 '23 10:03 fivestones

git checkout dev pip install -e .

erogol avatar Apr 03 '23 09:04 erogol

can install successfully but when trying to synthesis it gives the following bus error on a m1 mac zsh: bus error tts --text "xxx" --model_path "checkpoint_50000.pth"

pathnirvana avatar Apr 14 '23 07:04 pathnirvana

I'm on an M1 mac mini and a simple brew install mecab just helped me install TTS successfully.

itachiluan avatar Apr 16 '23 10:04 itachiluan

I'm also on m1 mac and brew install mecab made TTS installation work. That, plus pinning to Python 3.10.11.

aedocw avatar Apr 20 '23 21:04 aedocw

I close this issue. I was able to install on M1 a couple of times with no issue.s

erogol avatar Apr 21 '23 09:04 erogol