Correct way to install python libraries using requirements file

Open
#529 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, python
Domain
devops

Research direction

Start with the Dockerfile and requirements.txt installation commands shown in the issue, then reproduce the externally-managed-environment error with the Odoo 18 image. Compare supported dependency-installation approaches and confirm the selected approach builds successfully without the reported error.

Written by the indexing model from the issue text.

Description

Hello everyone, When working with the new version of Odoo 18 I checked that the docker file was modified based on the image with which it is working. This led to my old lines to add python libraries no longer working due to an error that says the following
error: externally-managed-environment

# Copy and install python dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt# Copy and install python dependencies

Previously they used to use these lines to achieve this. Does anyone know what is the best way to continue using a requirements file and be able to install the python libraries?

I found that using the following line I can skip the restriction but do you think it is correct or what is the best way to manage the libraries?
RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt

Dominant language
Dockerfile
Stars
1.2k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from odoo/docker

All issues in odoo/docker

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.