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

ttslearnのインストールについて #38

Open
masahiroview opened this issue Aug 1, 2022 · 7 comments
Open

ttslearnのインストールについて #38

masahiroview opened this issue Aug 1, 2022 · 7 comments

Comments

@masahiroview
Copy link

初めまして。masahiroviewと申します。
書籍「Pythonで学ぶ音声合成」を参考に、合成音声の機械学習環境の構築に取り組んでおります。
デモを使って学習する際に問題が発生しましたので、ご連絡させていただいた次第です。

https://r9y9.github.io/ttslearn/latest/notebooks/ch10_Recipe-Tacotron.html
こちらのデモを基に、実際に環境を構築しようとしたのですが、ttslearnのインストールができない状況です。

●環境概要:aws、sagemakerのノートブックにて構築。

●インストールコマンド、エラーメッセージ
!pip install ttslearn

エラーメッセージーーーーーーーーーーーーーーーーーー
Looking in indexes: https://pypi.org/simple, https://pip.repos.neuron.amazonaws.com/
Collecting ttslearn
Using cached ttslearn-0.2.2.tar.gz (295 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting hydra-core>=1.1.0
Using cached hydra_core-1.2.0-py3-none-any.whl (151 kB)
Requirement already satisfied: tqdm in /home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages (from ttslearn) (4.62.3)
Collecting pyopenjtalk>=0.1.0
Using cached pyopenjtalk-0.2.0.tar.gz (1.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Traceback (most recent call last):
File "/usr/local/bin/cmake", line 5, in
from cmake import cmake
ModuleNotFoundError: No module named 'cmake'
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
main()
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-slvgpo17/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
return self._get_build_requires(
File "/tmp/pip-build-env-slvgpo17/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-slvgpo17/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-slvgpo17/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 154, in
File "/home/ec2-user/anaconda3/envs/python3/lib/python3.8/subprocess.py", line 448, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['cmake', '..', '-DHTS_ENGINE_INCLUDE_DIR=.', '-DHTS_ENGINE_LIB=dummy']' returned non-zero exit status 1.
[end of output]

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

× Getting requirements to build wheel 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.
WARNING: You are using pip version 22.0.4; however, version 22.2.1 is available.
You should consider upgrading via the '/home/ec2-user/anaconda3/envs/python3/bin/python -m pip install --upgrade pip' command.
ーーーーーーーーーーーーーーーーーーーーーーーーーーーー

エラーメッセージを参考に、cmakeのアップデートを試したのですが、改善しませんでした。

●以下、関連のありそうな情報を記載します。

コマンド
!python --version
!gcc -v
!cmake --version

以下、ログ出力ーーーーーーーーーーーーーーーーーー
Python 3.8.12
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-libsanitizer --enable-gnu-indirect-function --enable-libcilkrts --enable-libatomic --enable-libquadmath --enable-libitm --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180712 (Red Hat 7.3.1-13) (GCC)
cmake version 3.22.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
ーーーーーーーーーーーーーーーーーーーーーーーーー

github上での質問をするのが、今回初めてですので、至らぬ点もあるかもしれません。
お忙しいところ恐縮ですが、ご回答いただけますと幸いです。

@r9y9
Copy link
Owner

r9y9 commented Aug 1, 2022

報告ありがとうございます。r9y9/pyopenjtalk#34 こちらと同一だと思いますが、私の環境で再現できるかどうか確認してみます。

@masahiroview
Copy link
Author

masahiroview commented Aug 2, 2022

ご返信ありがとうございます。
ご指摘の通り、r9r9/pyopenjtalk#34 と同一の質問です。
どちらで質問するのが適切かわからず、失礼ながら両方に質問を送らせていただいた次第です。

r9y9様の環境にて確認していただけるとのことで、誠にありがとうございます。
何卒よろしくお願いいたします。

@masahiroview
Copy link
Author

masahiroview commented Aug 2, 2022

質問について、追記させていただきます。
上記エラーはsagemaker環境にて発生したため、
実験的にec2環境でも試してみたところ、同様のエラーが発生しましたのでご報告いたします。

●以下、エラー文
Traceback (most recent call last):
File "/home/user/.local/bin/cmake", line 5, in
from cmake import cmake
ModuleNotFoundError: No module named 'cmake'

●以下、環境情報
コマンド

python3 --version
gcc -v
cmake --version

以下、ログ出力ーーーーーーーーーーーー
Python 3.7.10
組み込み spec を使用しています。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
ターゲット: x86_64-redhat-linux
configure 設定: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-libsanitizer --enable-gnu-indirect-function --enable-libcilkrts --enable-libatomic --enable-libquadmath --enable-libitm --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
スレッドモデル: posix
gcc バージョン 7.3.1 20180712 (Red Hat 7.3.1-15) (GCC)
cmake version 3.23.3
ーーーーーーーーーーーーーーーーーーーー

お忙しいところ恐縮ですが、合わせてご確認いただけますと幸いです。

@masahiroview
Copy link
Author

繰り返し失礼いたします。
pyopenjtalkのバージョンを下げていったところ、以下でダウンロードに成功しましたのでご報告します。
!pip install pyopenjtalk=="0.1.3"

@r9y9
Copy link
Owner

r9y9 commented Aug 7, 2022

Google colab、私のmacでは再現しませんでした。Googleで検索すると似たような問題 pypa/manylinux#178 (comment) が見つかりますが、pyopenjtalkやttslearnの問題ではなく、cmakeに関連する問題だと思います。コマンドラインから cmake を実行して、同様のエラーが出ないか、cmakeのバージョンを変えることで解決しないか、複数のcmakeがインストールされていて予期せぬ動作を及ぼしていないかなど、調べていただけますでしょうか

@masahiroview
Copy link
Author

masahiroview commented Aug 8, 2022

検証していただいて、ありがとうございます!
cmakeについて、バージョン変更等試してみます。

@bachelorwang
Copy link

I found out that this issue is actually caused by pip's cmake installation script.
To reproduce this bug, you can check your cmake path by which, it should be /usr/bin/cmake.
But once you executed pip install cmake, then it will be /home/<username>/.local/bin/cmake.
You can cat this one, you will find out the cmake installed by pip is a shebang:

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from cmake import cmake
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(cmake())

which is wrongly use the global's python bin, instead of your virtual environment's.
To fix this, make sure your cmake's path is /usr/bin/cmake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants