3

I am trying to balena push a Dockerfile. After several adjustments of my code, it still comes with error and unable to be pushed. My code is shown:

 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"]

And the error :

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-xtrlkujj/pyaudio/
Nilay Singh
  • 2,201
  • 6
  • 31
  • 61
夏思阳
  • 57
  • 1
  • 4
  • 10
  • you'll need to paste more, the error is above the output line you pasted – anthony sottile Apr 30 '20 at 03:04
  • @AnthonySottile `Step 5/8 : RUN pip3 install pyaudio numpy matplotlib scipy librosa [main] Collecting pyaudio [main] Complete output from command python setup.py egg_info: [main] Traceback (most recent call last): [main] File "", line 1, in [main] ModuleNotFoundError: No module named 'setuptools'- [main] Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-3vpz6pbo/pyaudio/ [main] The command '/bin/sh -c pip3 install pyaudio numpy matplotlib scipy librosa' returned a non-zero code: 1` – 夏思阳 Apr 30 '20 at 03:30
  • you're missing `python3-setuptools` – anthony sottile Apr 30 '20 at 03:39

2 Answers2

5

Try run first:

pip3 install --upgrade setuptools

to make sure you have the recent version from the Setuptools package. That sometimes fixes that problem.

And if pip needs setup tools to work. So if you don't have it you need to install it with

apt-get install python3-setuptools
ex4
  • 2,289
  • 1
  • 14
  • 21
  • 1
    I tried, it comes with same error with `Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-3vpz6pbo/pyaudio/` – 夏思阳 Apr 30 '20 at 03:31
  • In that case, try to install `python3-setuptools` with apt. `apt-get install python3-setuptools` – ex4 Apr 30 '20 at 03:43
  • yes it is solved. But it comes with another error that ` Failed building wheel for pyaudio` and `Failed building wheel for llvmlite` – 夏思阳 Apr 30 '20 at 03:57
  • 1
    @夏思阳 Did you figure out a fix for this? I'm having the same issue. – Mr.Young Aug 26 '20 at 04:43
  • 1
    @Mr.Young Yes, you can try with `RUN apt-get update` at each line instead of connecting with '&&' – 夏思阳 Aug 27 '20 at 05:27
  • @夏思阳 Thanks. I ended up installing Anaconda and then everything worked out fine. – Mr.Young Aug 27 '20 at 08:58
  • `no such option: --upgrade` – alper Nov 26 '20 at 10:46
  • You're missing the ``install''. It should be ``pip3 install --upgrade setuptools`` (otherwise error "no such option: --upgrade") – maurera May 07 '21 at 17:48
1
$ pip3 --upgrade setuptools

Usage:   
  pip3 <command> [options]

no such option: --upgrade

Then I use this from this web

$ sudo apt install python3-pyqt5

Kearney
  • 153
  • 1
  • 5