首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试运行这些命令来安装soundfile和pyaudio并得到这些错误,我该如何解决它们

尝试运行这些命令来安装soundfile和pyaudio并得到这些错误,我该如何解决它们
EN

Stack Overflow用户
提问于 2020-10-28 09:09:07
回答 1查看 82关注 0票数 0
代码语言:javascript
复制
pip install librosa soundfile numpy sklearn pyaudio

这是我正在尝试运行的命令(在jupyter笔记本上)

这是我得到的错误:

代码语言:javascript
复制
Building wheels for collected packages: pyaudio
  Building wheel for pyaudio (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /srv/conda/envs/notebook/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mn4s9s0y/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mn4s9s0y/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ll89n0e4
       cwd: /tmp/pip-install-mn4s9s0y/pyaudio/
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  copying src/pyaudio.py -> build/lib.linux-x86_64-3.6
  running build_ext
  building '_portaudio' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  gcc -pthread -B /srv/conda/envs/notebook/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/srv/conda/envs/notebook/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.6/src/_portaudiomodule.o
  src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory
   #include "portaudio.h"
            ^~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyaudio
  Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
    Running setup.py install for pyaudio ... error
    ERROR: Command errored out with exit status 1:
     command: /srv/conda/envs/notebook/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mn4s9s0y/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mn4s9s0y/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-tjfq5_3b/install-record.txt --single-version-externally-managed --compile --install-headers /srv/conda/envs/notebook/include/python3.6m/pyaudio
         cwd: /tmp/pip-install-mn4s9s0y/pyaudio/
    Complete output (16 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    copying src/pyaudio.py -> build/lib.linux-x86_64-3.6
    running build_ext
    building '_portaudio' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -B /srv/conda/envs/notebook/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/srv/conda/envs/notebook/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.6/src/_portaudiomodule.o
    src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory
     #include "portaudio.h"
              ^~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /srv/conda/envs/notebook/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mn4s9s0y/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mn4s9s0y/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-tjfq5_3b/install-record.txt --single-version-externally-managed --compile --install-headers /srv/conda/envs/notebook/include/python3.6m/pyaudio Check the logs for full command output.

有人能帮我解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2021-07-05 23:13:46

如果您在运行上述代码行时遇到问题,请尝试执行以下命令:

代码语言:javascript
复制
pip install pipwin                                                                
pipwin install pyaudio
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64565081

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档