Install pip package such as backtrader in the jupyter/datascience-notebook image

thank you for your msg. I am a bit confused again. Where do I reference the environment.yml??

This is how I added some of the the packages:

FROM jupyter/datascience-notebook

USER root

RUN apt-get update && \
    apt-get install libpq-dev  -y && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

USER ${NB_UID}

# R packages including IRKernel which gets installed globally.
# Ref: https://github.com/jupyter/docker-stacks/tree/main/datascience-notebook
RUN mamba install --quiet --yes \
    'r-getpass' \
    'r-rpostgresql' && \
    mamba clean --all -f -y && \
    fix-permissions "${CONDA_DIR}" && \
    fix-permissions "/home/${NB_USER}"

# Install new packages in the default python3 environment
# Ref: https://github.com/jupyter/docker-stacks/tree/main/scipy-notebook
RUN mamba install --quiet --yes \
    'spacy' \
    'ta-lib' && \
    mamba clean --all -f -y && \
    fix-permissions "${CONDA_DIR}" && \
    fix-permissions "/home/${NB_USER}"

# Install backtrader using pip because it's not available in conda
RUN pip install --no-cache-dir backtrader

Is this ok or I could improve it by saving some space?

thanks