首页 > 解决方案 > 命令“python setup.py egg_info”在 /tmp/pip-install-xtrlkujj/pyaudio/ 中失败,错误代码为 1

问题描述

我正在尝试 balena 推送一个 Dockerfile。我的代码经过多次调整,还是报错,无法推送。我的代码显示:

 FROM balenalib/fincm3-debian-python:latest

# RUN install_packages git

RUN apt-get update 
RUN apt-get install python -y\
        && apt-get install python3-pip -y
RUN apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev -y 
RUN pip3 install pyaudio numpy matplotlib \
             scipy librosa

# Set our working directory
WORKDIR /usr/src/app

COPY Recorder.py /usr/src/app

# Recorder.py will run when the container starts up on the device
CMD ["python","/usr/src/app/Recorder.py"]

和错误:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-xtrlkujj/pyaudio/

标签: pythondockerdockerfilebalena

解决方案


尝试先运行:

pip3 install --upgrade setuptools

以确保您拥有 Setuptools 包中的最新版本。这有时可以解决这个问题。

如果 pip 需要设置工具才能工作。所以如果你没有它,你需要安装它

apt-get install python3-setuptools

推荐阅读