Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/bin/sh: pip3: not found error on alpine 3.12 #91

Closed
prabhb1 opened this issue Jun 8, 2020 · 4 comments · Fixed by cyberark/KubiScan#31
Closed

/bin/sh: pip3: not found error on alpine 3.12 #91

prabhb1 opened this issue Jun 8, 2020 · 4 comments · Fixed by cyberark/KubiScan#31

Comments

@prabhb1
Copy link

prabhb1 commented Jun 8, 2020

Hello team!

We are getting a new issue after moving from alpine version 3.11 to 3.12(latest). Please find the docker image snippet and where the error occurs:

RUN apk add --no-cache python3 openssl ca-certificates git openssh sshpass
&& apk --update add --virtual build-dependencies python3-dev libffi-dev openssl-dev build-base
&& pip3 install --upgrade pip cffi

Stacktrace:
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/24) Installing ca-certificates (20191127-r2)
(2/24) Installing nghttp2-libs (1.40.0-r0)
(3/24) Installing libcurl (7.69.1-r0)
(4/24) Installing expat (2.2.9-r1)
(5/24) Installing pcre2 (10.35-r0)
(6/24) Installing git (2.26.2-r0)
(7/24) Installing openssh-keygen (8.3_p1-r0)
(8/24) Installing ncurses-terminfo-base (6.2_p20200523-r0)
(9/24) Installing ncurses-libs (6.2_p20200523-r0)
(10/24) Installing libedit (20191231.3.1-r0)
(11/24) Installing openssh-client (8.3_p1-r0)
(12/24) Installing openssh-sftp-server (8.3_p1-r0)
(13/24) Installing openssh-server-common (8.3_p1-r0)
(14/24) Installing openssh-server (8.3_p1-r0)
(15/24) Installing openssh (8.3_p1-r0)
(16/24) Installing openssl (1.1.1g-r0)
(17/24) Installing libbz2 (1.0.8-r1)
(18/24) Installing libffi (3.3-r2)
(19/24) Installing gdbm (1.13-r1)
(20/24) Installing xz-libs (5.2.5-r0)
(21/24) Installing readline (8.0.4-r0)
(22/24) Installing sqlite-libs (3.32.1-r0)
(23/24) Installing python3 (3.8.3-r0)
(24/24) Installing sshpass (1.06-r0)
Executing busybox-1.31.1-r16.trigger
Executing ca-certificates-20191127-r2.trigger
OK: 75 MiB in 38 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/26) Installing pkgconf (1.7.2-r0)
(2/26) Installing python3-dev (3.8.3-r0)
(3/26) Installing linux-headers (5.4.5-r1)
(4/26) Installing libffi-dev (3.3-r2)
(5/26) Installing openssl-dev (1.1.1g-r0)
(6/26) Installing libgcc (9.3.0-r2)
(7/26) Installing libstdc++ (9.3.0-r2)
(8/26) Installing binutils (2.34-r1)
(9/26) Installing libmagic (5.38-r0)
(10/26) Installing file (5.38-r0)
(11/26) Installing gmp (6.2.0-r0)
(12/26) Installing isl (0.18-r0)
(13/26) Installing libgomp (9.3.0-r2)
(14/26) Installing libatomic (9.3.0-r2)
(15/26) Installing libgphobos (9.3.0-r2)
(16/26) Installing mpfr4 (4.0.2-r4)
(17/26) Installing mpc1 (1.1.0-r1)
(18/26) Installing gcc (9.3.0-r2)
(19/26) Installing musl-dev (1.1.24-r8)
(20/26) Installing libc-dev (0.7.2-r3)
(21/26) Installing g++ (9.3.0-r2)
(22/26) Installing make (4.3-r0)
(23/26) Installing fortify-headers (1.1-r0)
(24/26) Installing patch (2.7.6-r6)
(25/26) Installing build-base (0.5-r2)
(26/26) Installing build-dependencies (20200601.084206)
Executing busybox-1.31.1-r16.trigger
OK: 330 MiB in 64 packages
/bin/sh: pip3: not found

Error:
/bin/sh: pip3: not found
ERROR: Job failed: exit code 127

We would love to hear if there are any changes that python3-dev or python related in 3.12 version which is affecting the pip3 not found error.

Note: This was working fine in the version 3.11

Workaround: We added the py-pip library and is working as expected without the above-mentioned error.

@ncopa
Copy link
Contributor

ncopa commented Jun 9, 2020

You can also do: apk add cmd:pip3 which will pull in whatever package that provides pip3 command. That way you don't need replace py-pip with something else (py3-pip?) if it changes in the future.

@ncopa ncopa closed this as completed Jun 9, 2020
@prabhb1
Copy link
Author

prabhb1 commented Jun 9, 2020

@ncopa: Thanks for the suggestion, we will update the pip3 command externally.
I just wanted to know as to what is the RCA for this issue, as in were there any changes wrt Python or python-dev libraries? Thanks in advance for the response.

@magiccrafter
Copy link

@ncopa: Thanks for the suggestion, we will update the pip3 command externally.
I just wanted to know as to what is the RCA for this issue, as in were there any changes wrt Python or python-dev libraries? Thanks in advance for the response.

pip3 doesn't come with apk add python3 anymore. The issue is not related to alipne image.

tanmally pushed a commit to geekassess/mysql-backup that referenced this issue Sep 27, 2020
@praveensanpada
Copy link

This is my first step and i am getting this error

from alpine:latest

RUN apk add --no-cache python3-dev
&& pip3 install --upgrade pip

/bin/sh: pip3: not found
The command '/bin/sh -c apk add --no-cache python3-dev && pip3 install --upgrade pip setuptools' returned a non-zero code: 127

Esysc added a commit to Pix4D/concourse-pool-boy that referenced this issue Mar 24, 2023
Esysc added a commit to Pix4D/concourse-pool-boy that referenced this issue Mar 24, 2023
See: alpinelinux/docker-alpine#91

Add curl and jq package in order to retreive updated keys directly from GitHub.
Esysc added a commit to Pix4D/concourse-pool-boy that referenced this issue Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants