melange
melange copied to clipboard
Build with runtime python but pip could not find pip
I'm trying to build an apk with a client tool (pulsar-client), however, I would receive the following error when I run the code with
docker run --privileged --rm -v "${PWD}":/work \
cgr.dev/chainguard/melange build python-melange.yaml \
--arch x86,amd64,aarch64,armv7 \
--signing-key melange.rsa
Exception : importlib.metadata.PackageNotFoundError: No package metadata was found for pip
The file is:
package:
name: pulsar-python-client
version: 0.1.0
description: An custom apk packaing including pulsar python client
target-architecture:
- all
copyright:
- license: Apache-2.0
paths:
- "*"
dependencies:
runtime:
- python3
environment:
contents:
repositories:
- https://dl-cdn.alpinelinux.org/alpine/edge/main
- https://dl-cdn.alpinelinux.org/alpine/edge/community
packages:
- alpine-baselayout-data
- ca-certificates-bundle
- busybox
- gcc
- musl-dev
- python3
- python3-dev
- py3-pip
- py3-virtualenv
pipeline:
- name: install python client
runs: |
set -x
pip install pulsar-client==2.10.2
pip install pulsar-client[avro]=='2.10.2'
pip install pulsar-client[functions]=='2.10.2'
pip install pulsar-client[all]=='2.10.2'
I basically copied the code from https://github.com/chainguard-dev/hello-melange-apko/blob/main/py/melange.yaml, but it's not working.
Can we have an example how to install python?
maybe try python3 -m pip --version
. it seems to be working for me.
This was most likely due to python migration in Alpine. None the less, this is not an issue specific to Melange and should be directed to Alpine.