安装paddlespeech(二)

发布时间 2023-12-29 13:06:11作者: 大风吹屁股

现在是使用sudo 安装的paddlespeech

呜呜呜,报错如下

  Stored in directory: /root/.cache/pip/wheels/39/48/7d/a6f09f94eef5d47f02f3a9825313002894c59628550ede5e9a
  Building wheel for soxbindings (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      /usr/lib/python3/dist-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.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/effects.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/__init__.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/sox_cli.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/transform.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/audio.py -> build/lib.linux-x86_64-3.10/soxbindings
      running build_ext
      creating tmp
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c /tmp/tmpdszfwx18.cpp -o tmp/tmpdszfwx18.o -std=c++17
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c /tmp/tmp3lm6mhsy.cpp -o tmp/tmp3lm6mhsy.o -fvisibility=hidden
      building 'soxbindings._soxbindings' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/soxbindings
      creating build/temp.linux-x86_64-3.10/soxbindings/ext
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION_INFO="1.2.3" -I/tmp/pip-install-4w0qde6u/soxbindings_c5da5c36ce9a4f46a8e286f6eef28ed1/.eggs/pybind11-2.11.1-py3.10.egg/pybind11/include -I/usr/include/python3.10 -c soxbindings/ext/sox.cpp -o build/temp.linux-x86_64-3.10/soxbindings/ext/sox.o -lsox -std=c++17 -fvisibility=hidden
      soxbindings/ext/sox.cpp:4:10: fatal error: sox.h: 没有那个文件或目录
          4 | #include <sox.h>
            |          ^~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for soxbindings
  Running setup.py clean for soxbindings
  Building wheel for webrtcvad (setup.py) ... done
  Created wheel for webrtcvad: filename=webrtcvad-2.0.10-cp310-cp310-linux_x86_64.whl size=73496 sha256=7959d75cc7886d7b9dc6bbd601f6e61055b3b0d5d2e2a449f2b9a573743c70d9
  Stored in directory: /root/.cache/pip/wheels/10/81/a4/4a1bd096b5d6e718e34d6a6890b43c553a8c0c873586222b48
  Building wheel for distance (setup.py) ... done
  Created wheel for distance: filename=Distance-0.1.3-py3-none-any.whl size=16276 sha256=267644502452c2f47ffc458fed3e374694f7b5583ba6692864d7cd484a5080af
  Stored in directory: /root/.cache/pip/wheels/d8/45/38/09f00b4590c4e4990ebab9851e5165f6309293f3c7b42792de
  Building wheel for jieba (setup.py) ... done
  Created wheel for jieba: filename=jieba-0.42.1-py3-none-any.whl size=19314478 sha256=1a0f419e56280da8ec3bd43078421c5635aa47027f96996817b7be7bbfae19be
  Stored in directory: /root/.cache/pip/wheels/b2/9b/80/7537177f75993c29af08e0d00c753724c7f06c646352be50a3
  Building wheel for hanziconv (setup.py) ... done
  Created wheel for hanziconv: filename=hanziconv-0.3.2-py2.py3-none-any.whl size=23226 sha256=eff9a91e990aa63ea14bd2a2591d91bf7117c0231432de496459ecade4b5f34b
  Stored in directory: /root/.cache/pip/wheels/64/ec/9c/b3348d0bee92839bd6d86fd37115577d7ecb5f06f5902bd2f5
  Building wheel for antlr4-python3-runtime (setup.py) ... done
  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144575 sha256=c6b198a03d88ea96394743e5b8ab07708cc26a9edf93131a2a5ae35d25b666e4
  Stored in directory: /root/.cache/pip/wheels/fd/40/c6/c03a72bc01e732a4371de9a6c5f5d5a97436243fb7778d2e60
  Building wheel for seqeval (setup.py) ... done
  Created wheel for seqeval: filename=seqeval-1.2.2-py3-none-any.whl size=16180 sha256=7dc07fc8cda35aab28faac642ffbe6b2d457c7d7f9dd85f6f23071f58c5b0ceb
  Stored in directory: /root/.cache/pip/wheels/82/ac/b7/b63c2ea4da318aa5d8336b96c5140fe53496585e403df7c8ef
  Building wheel for intervaltree (setup.py) ... done
  Created wheel for intervaltree: filename=intervaltree-3.1.0-py2.py3-none-any.whl size=26119 sha256=e67a52c73d3b1ec6f5bd5d94b266d8554e8c1a8619d96f96e007b39fdbf06085
  Stored in directory: /root/.cache/pip/wheels/e1/67/20/23eae793e15f61afbc24763b5770d25b225e7bba8003f3e26f
  Building wheel for pretty-midi (setup.py) ... done
  Created wheel for pretty-midi: filename=pretty_midi-0.2.10-py3-none-any.whl size=5592305 sha256=6e9c23b7a58bde7af59775ec2c4e3f3cb6aebd4681c17365f9e42fb16499170e
  Stored in directory: /root/.cache/pip/wheels/0d/d8/11/1004d1b23c022a356c1c502302eb83d559668d3965154f7685
Successfully built pyworld gpustat pattern_singleton pypi-kenlm webrtcvad distance jieba hanziconv antlr4-python3-runtime seqeval intervaltree pretty-midi
Failed to build soxbindings
Installing collected packages: webrtcvad, wcwidth, trampoline, timer, textgrid, swig, sortedcontainers, sentencepiece, pytz, pypi-kenlm, pygtrie, pydub, pure-eval, paddlespeech_ctcdecoders, paddle2onnx, opencc-python-reimplemented, opencc, nvidia-ml-py, mpmath, jieba, hanziconv, flatbuffers, distlib, distance, braceexpand, boltons, antlr4-python3-runtime, zhon, yacs, xyzservices, xxhash, xmltodict, websockets, unidecode, tzdata, typing-extensions, typeguard, traitlets, tqdm, tornado, tomlkit, ToJyutping, threadpoolctl, tabulate, sympy, sniffio, safetensors, ruamel.yaml.clib, requests-mock, regex, rarfile, pyzmq, python-dateutil, pypinyin, pygments, pycryptodome, pycparser, pybind11, pyarrow-hotfix, psutil, protobuf, prompt-toolkit, prettytable, ppft, pox, portalocker, platformdirs, pattern_singleton, parso, parameterized, packaging, omegaconf, numpy, nodeenv, multidict, mock, mdurl, MarkupSafe, lxml, loguru, llvmlite, kiwisolver, joblib, itsdangerous, intervaltree, identify, humanfriendly, h11, g2pM, ftfy, fsspec, frozenlist, fonttools, filelock, executing, exceptiongroup, einops, editdistance, dill, decorator, cython, cycler, coverage, ConfigArgParse, colorlog, click, cfgv, blinker, blessed, Babel, audioread, attrs, async-timeout, asttokens, argcomplete, annotated-types, absl-py, yq, yarl, Werkzeug, virtualenv, uvicorn, typer, stack-data, sox, snakeviz, scipy, sacrebleu, ruamel.yaml, pyworld, pypinyin-dict, pydantic-core, pyarrow, praatio, pooch, pandas, paddlefsl, opencv-python, onnx, numba, nltk, multiprocess, mido, matplotlib-inline, markdown-it-py, kaldiio, jsonlines, Jinja2, jedi, huggingface-hub, h5py, gpustat, contourpy, coloredlogs, cffi, bottleneck, bce-python-sdk, anyio, aiosignal, starlette, soxbindings, soundfile, scikit-learn, rich, resampy, pydantic, pretty-midi, pre-commit, pathos, paddlespeech_feat, paddlesde, onnxruntime, matplotlib, IPython, hyperpyyaml, Flask, bokeh, aiohttp, seqeval, paddleslim, nara_wpe, librosa, inflect, Flask-Babel, fastapi, visualdl, phkit, paddleaudio, note-seq, g2p_en, datasets, paddlenlp, ppdiffusers, paddlespeech
  Attempting uninstall: pytz
    Found existing installation: pytz 2022.1
    Not uninstalling pytz at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'pytz'. No files were found to uninstall.
  Attempting uninstall: python-dateutil
    Found existing installation: python-dateutil 2.8.1
    Not uninstalling python-dateutil at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'python-dateutil'. No files were found to uninstall.
  Attempting uninstall: protobuf
    Found existing installation: protobuf 3.12.4
    Not uninstalling protobuf at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'protobuf'. No files were found to uninstall.
  Attempting uninstall: MarkupSafe
    Found existing installation: MarkupSafe 2.0.1
    Not uninstalling markupsafe at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'MarkupSafe'. No files were found to uninstall.
  Attempting uninstall: click
    Found existing installation: click 8.0.3
    Not uninstalling click at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'click'. No files were found to uninstall.
  Attempting uninstall: blinker
    Found existing installation: blinker 1.4
    Not uninstalling blinker at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'blinker'. No files were found to uninstall.
  Running setup.py install for soxbindings ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for soxbindings did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      running install
      /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/effects.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/__init__.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/sox_cli.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/transform.py -> build/lib.linux-x86_64-3.10/soxbindings
      copying soxbindings/audio.py -> build/lib.linux-x86_64-3.10/soxbindings
      running build_ext
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c /tmp/tmpp_nilbiw.cpp -o tmp/tmpp_nilbiw.o -std=c++17
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c /tmp/tmpi2ticytw.cpp -o tmp/tmpi2ticytw.o -fvisibility=hidden
      building 'soxbindings._soxbindings' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/soxbindings
      creating build/temp.linux-x86_64-3.10/soxbindings/ext
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DVERSION_INFO="1.2.3" -I/usr/local/lib/python3.10/dist-packages/pybind11/include -I/usr/include/python3.10 -c soxbindings/ext/sox.cpp -o build/temp.linux-x86_64-3.10/soxbindings/ext/sox.o -lsox -std=c++17 -fvisibility=hidden
      soxbindings/ext/sox.cpp:4:10: fatal error: sox.h: 没有那个文件或目录
          4 | #include <sox.h>
            |          ^~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> soxbindings

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

错误信息表明缺少 sox.h 文件,这是 soxbindings 包编译所需的头文件之一。

运行

sudo apt-get install sox

然而并没有什么用

运行

sudo apt-get install libsox-dev

再次运行安装paddlespeech,好使了。

 

分析原因

libsox-dev: 要安装的软件包的名称。在这种情况下,它是 SoX 库的开发版本,包括头文件和静态库,使得开发人员可以使用 SoX 的功能进行音频处理。

吐槽

真是可恶,里面居然没有给安装libsox-dev,直接调用soxbindings。这不是纯纯玩弄感情吗。

好在这个问题解决了。进入下一个问题

未完待续

paddlespeech(三)