Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Docker Debian and python base58

I have this Docker image

FROM debian

RUN  apt-get update \
    && apt-get install -y \
    autoconf \
    build-essential \
    bc \
    curl \
    git \
    wget \
    jq \
    libssl-dev \
    libtool \
    net-tools \
    openssl \
    python3-pip \
    pkg-config \
    procps \
    sed \
    vim \
    xxd \
    ca-certificates \
    gnupg \
    dc \
    zsh \
    && apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

   RUN pip install base58

and I get this error since 2 week

    > [ 3/11] RUN pip install base58:
#0 2.868 error: externally-managed-environment
#0 2.868
#0 2.868 × This environment is externally managed
#0 2.868 ╰─> To install Python packages system-wide, try apt install
#0 2.868     python3-xyz, where xyz is the package you are trying to
#0 2.868     install.
#0 2.868
#0 2.868     If you wish to install a non-Debian-packaged Python package,
#0 2.868     create a virtual environment using python3 -m venv path/to/venv.
#0 2.868     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
#0 2.868     sure you have python3-full installed.
#0 2.868
#0 2.868     If you wish to install a non-Debian packaged Python application,
#0 2.868     it may be easiest to use pipx install xyz, which will manage a
#0 2.868     virtual environment for you. Make sure you have pipx installed.
#0 2.868
#0 2.868     See /usr/share/doc/python3.11/README.venv for more information.
#0 2.868
#0 2.868 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override

this, at the risk of breaking your Python installation or OS, by
passing –break-system-packages.
#0 2.868 hint: See PEP 668 for the detailed specification.
——
failed to solve: executor failed running [/bin/sh -c pip install base58]: exit code: 1

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I have this error since two weeks, and I don’t understand how can I resolve it. I’m trying to create very slim image without lucky

>Solution :

A good practice when creating docker images is to set a tag to the image you are using to avoid breaking changes from version to version like so: FROM debian:12-slim. Otherwise its going to use the latest tag and download whatever is latest.

The message is very clear.

To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you want it system-wide you are going to need to install it with apt instead of pip, apt install python3-base58

Or use a virtual environment

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading