alpine package py-pip missing
Asked Answered
F

10

79

Im trying to install python pip in my alpine using Docker compose file but get the following error.

ERROR: unsatisfiable constraints:
  py-pip (missing):
    required by: world[py-pip]
ERROR: Service 'web' failed to build: The command '/bin/sh -c apk add py-pip' returned a non-zero code: 1
Freddafreddi answered 19/6, 2017 at 14:58 Comment(1)
Have a look at pkgs.alpinelinux.org/package/v3.3/main/x86/py-pipMckoy
P
112

Do update first:

apk add --update py-pip

Or:

apk update
apk add py-pip
Puerility answered 19/6, 2017 at 15:29 Comment(0)
E
25

You have to use appropriate pip version depending on Alpine branch:

  • Alpine v3.12 or newer, use apk add --update py3-pip
  • Alpine v3.5 - v3.11, use apk add --update py2-pip
  • Alpine v3.3 - v3.4, use apk add --update py-pip
Embolus answered 28/1, 2021 at 0:49 Comment(0)
E
23

For python3 on alpine edge:

apk add py3-setuptools

Earmark answered 9/1, 2019 at 21:17 Comment(1)
That's also "missing"Orelia
P
8

For me --no-cache option worked.

apk add --no-cache py-pip

Ptyalin answered 3/9, 2018 at 11:2 Comment(0)
M
8

I've found the following:

$ apk add --update py3-pip
Merc answered 17/8, 2020 at 11:18 Comment(0)
W
5

Following command in the console should work with any linux distro:

python -m ensurepip --upgrade

Tested succesfully with Alpine v3.17 the VM edition. More details here.

Willingham answered 12/12, 2022 at 19:27 Comment(0)
N
1

AlpineWSL 3.14.0 | Last commands is a solution, info from ircs://irc.oftc.net/alpine-linux

apk update
apk upgrade
apk add python2
python -m ensurepip --upgrade

Example

pip install -r requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
...
Successfully installed certifi-2021.10.8 chardet-4.0.0 idna-2.10 requests-2.26.0 urllib3-1.26.7
WARNING: You are using pip version 19.2.3, however version 20.3.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Notch answered 9/10, 2021 at 21:38 Comment(2)
This worked for me for Python 3 (specifically using python3 instead of python2) on Alpine 3.17.0-rc4Zoochore
its 2023 where Python2 is officially dead and unsupported by the python software foundation. Users should not downgrade to prior versions.Musso
M
1

For future folks running into this and similar issues with missing packages, you might just need to edit /etc/apk/repositories and uncomment the 'community' repo.

py-pip and py3-pip at least are there.

Mun answered 27/3 at 18:39 Comment(0)
B
-1

You need to modify your repository:

Modify the file /etc/apk/repositories

Add the repository community

g.e.:

/media/mmcblk0p1/apks
http://alpine.42.fr/v3.14/main
http://alpine.42.fr/v3.14/community

For me, the server used is http://alpine.42.fr, but you can use another server

Don't forget to commit your change if you want to have this configuration permanently

lbu commit -d
Booher answered 25/10, 2021 at 18:59 Comment(0)
H
-2

This worked for me:

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && python get-pip.py
Helyn answered 18/1, 2022 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.