简体   繁体   English

我尝试在我的 Linux Mint 上安装 pyaudio 时出错

[英]I got an error while I'm trying to install pyaudio on my Linux Mint

This is the following error:这是以下错误:

Collecting pyaudio
  Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
    Running setup.py install for pyaudio ... error
    ERROR: Command errored out with exit status 1:
     command: /home/gameologist/PycharmProjects/virtualassistant/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xtvkc0zh/pyaudio_4534e484b2cf48c7be3c983e99506f2c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xtvkc0zh/pyaudio_4534e484b2cf48c7be3c983e99506f2c/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'"'"'))' install --record /tmp/pip-record-vo7m84xe/install-record.txt --single-version-externally-managed --compile --install-headers /home/gameologist/PycharmProjects/virtualassistant/venv/include/site/python3.6/pyaudio
         cwd: /tmp/pip-install-xtvkc0zh/pyaudio_4534e484b2cf48c7be3c983e99506f2c/
    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
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/gameologist/PycharmProjects/virtualassistant/venv/include -I/usr/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.6/src/_portaudiomodule.o
    src/_portaudiomodule.c:28:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/gameologist/PycharmProjects/virtualassistant/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xtvkc0zh/pyaudio_4534e484b2cf48c7be3c983e99506f2c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xtvkc0zh/pyaudio_4534e484b2cf48c7be3c983e99506f2c/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'"'"'))' install --record /tmp/pip-record-vo7m84xe/install-record.txt --single-version-externally-managed --compile --install-headers /home/gameologist/PycharmProjects/virtualassistant/venv/include/site/python3.6/pyaudio Check the logs for full command output.

I tried everything....but still I get this same error !!我什么都试过了……但我仍然遇到同样的错误!!

I had the same issue in WSL.我在 WSL 中遇到了同样的问题。 Was getting the errors:收到错误:

  • 'wheel' is not installed
  • Python.h: No such file or directory
  • portaudio.h: No such file or directory

Solved it by installing the following system packages:通过安装以下系统包来解决它:

  • python3-dev
  • python-wheel-common
  • portaudio19-dev
$ sudo apt install python3-dev python-wheel-common portaudio19-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM