高山包 py-pip 丢失

alpine package py-pip missing

我正在尝试使用 Docker 撰写文件在我的 alpine 中安装 python pip 但出现以下错误。

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

先做update

apk add --update py-pip

或者:

apk update
apk add py-pip

对我来说 --no-cache 选项有效。

apk add --no-cache py-pip

python3 在高山边缘:

apk add py3-setuptools

我发现了以下内容:

$ apk add --update py3-pip

您必须根据 Alpine 分支使用适当的 pip 版本:

  • A​​lpine v3.12 或更新版本,使用 apk add --update py3-pip
  • A​​lpine v3.5 - v3.11,使用apk add --update py2-pip
  • A​​lpine v3.3 - v3.4,使用apk add --update py-pip

命令'/bin/sh -c pip install django-mass-edit && pip install django-admin-list-filter-dropdown && pip install SQLAlchemy && pip

AlpineWSL 3.14.0 |最后的命令是一个解决方案,来自 ircs://irc.oftc.net/alpine-linux

的信息
apk update
apk upgrade
apk add python2
python -m ensurepip --upgrade

例子

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.

您需要修改存储库:

修改文件/etc/apk/repositories

添加存储库社区

g.e.:

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

对我来说,使用的服务器是http://alpine.42.fr,但你可以使用其他服务器

如果您想永久拥有此配置,请不要忘记提交您的更改

lbu commit -d

这对我有用:

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && python get-pip.py