困难的安装PyAudio在Mac M1

0

的问题

请注意,答案已经提供了关于堆叠的溢出有不为我工作。 包括但不限于:

brew update
brew install portaudio
brew link --overwrite portaudio
pip install pyaudio

我可以使用一些帮助的人实际上是愿意帮助。

当我运行的功能上所述,一切正常,直到我打的 pip install pyaudio 行,然后该错误下发生:

WARNING: Discarding https://files.pythonhosted.org/packages/d0/dc/ffb9ce5e3f19bd289902915a9f68b7d199216065f8ea17d5b5e8e4ad86ee/PyAudio-0.2.9.tar.gz#sha256=bfd694272b3d1efc51726d0c27650b3c3ba1345f7f8fdada7e86c9751ce0f2a1 (from https://pypi.org/simple/pyaudio/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached pyaudio-0.2.8.tar.gz (235 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lw/_gcm85s107z9sbgqyrw5pw700000gn/T/pip-install-vvvb_ho8/pyaudio_ebec704a423648cfb3b175c8def295f6/setup.py'"'"'; __file__='"'"'/private/var/folders/lw/_gcm85s107z9sbgqyrw5pw700000gn/T/pip-install-vvvb_ho8/pyaudio_ebec704a423648cfb3b175c8def295f6/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'"'"'))' egg_info --egg-base /private/var/folders/lw/_gcm85s107z9sbgqyrw5pw700000gn/T/pip-pip-egg-info-j7szc61a
       cwd: /private/var/folders/lw/_gcm85s107z9sbgqyrw5pw700000gn/T/pip-install-vvvb_ho8/pyaudio_ebec704a423648cfb3b175c8def295f6/
  Complete output (15 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/lw/_gcm85s107z9sbgqyrw5pw700000gn/T/pip-install-vvvb_ho8/pyaudio_ebec704a423648cfb3b175c8def295f6/setup.py", line 124, in <module>
      setup(name = 'PyAudio',
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 121, in setup
      dist.parse_config_files()
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 796, in parse_config_files
      self._parse_config_files(filenames=filenames)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 664, in _parse_config_files
      parser.read_file(reader)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/configparser.py", line 719, in read_file
      self._read(f, source)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/configparser.py", line 1097, in _read
      raise DuplicateOptionError(sectname, optname,
  configparser.DuplicateOptionError: While reading from '/Users/evvolvx/.pydistutils.cfg' [line  3]: option 'include_dirs' in section 'build_ext' already exists
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/06/d1/3d202c9187fb78ad6d4f8b476a8cc0ded7c1b47ca33d5dab73b959faf123/pyaudio-0.2.8.tar.gz#sha256=4f85367cf79657616684487037957ac38582ecc5389b89420fe61d901b719551 (from https://pypi.org/simple/pyaudio/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pyaudio (from versions: 0.2.8, 0.2.9, 0.2.10, 0.2.11)
ERROR: No matching distribution found for pyaudio

任何帮助,将不胜感激。 谢谢你

apple-m1 macos pyaudio python
2021-11-22 01:55:34
1

最好的答案

1

这是我的第一反应堆的溢出所以请原谅我对任何缺乏清晰度。 我尝试运行这一使用Python3.10点苹果硅,并注意到,安装者试图建立的模块从来源。 你应该看出这样完全错误信息。

Complete output (16 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11-x86_64-3.9
  copying src/pyaudio.py -> build/lib.macosx-11-x86_64-3.9
  running build_ext
  building '_portaudio' extension
  creating build/temp.macosx-11-x86_64-3.9
  creating build/temp.macosx-11-x86_64-3.9/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DMACOSX=1 -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-11-x86_64-3.9/src/_portaudiomodule.o
  src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
  #include "portaudio.h"
           ^~~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pyaudio

我刚刚遇到这个问题在安装psycopg2当我安装了它作为一个预建的二进制的,没有问题。

当时我写了这个答复,编制从源头上的苹果硅是不支持的几个模块,如PIL,这需要一个本地建造和不运行。 据我所知,这里是你的选择:

  1. 下载的轮手动,并找到一种方法汇编(不建议)
  2. 安装一个预建的二进制作了苹果硅(不存在,我所知道的)
  3. 安装了64位pyaudio建立其是罗塞塔兼容(简单)

有有用的答复对 这个问题 描述的过程中,安装了64位的版本。

2021-11-23 03:29:24

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................