Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix externally-managed-environment issue #103

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

obiscr
Copy link
Contributor

@obiscr obiscr commented Jul 22, 2024

When I try to build, I got this error

❯ docker build -t biosim4 .
[+] Building 0.4s (6/9)                                    docker:desktop-linux
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 646B                                       0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest           0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/6] FROM docker.io/library/ubuntu:latest                             0.0s
 => CACHED [2/6] RUN apt-get update && apt-get install -y  build-essentia  0.0s
 => ERROR [3/6] RUN pip install igraph                                     0.3s
------
 > [3/6] RUN pip install igraph:
0.306 error: externally-managed-environment
0.306
0.306 × This environment is externally managed
0.306 ╰─> To install Python packages system-wide, try apt install
0.306     python3-xyz, where xyz is the package you are trying to
0.306     install.
0.306
0.306     If you wish to install a non-Debian-packaged Python package,
0.306     create a virtual environment using python3 -m venv path/to/venv.
0.306     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
0.306     sure you have python3-full installed.
0.306
0.306     If you wish to install a non-Debian packaged Python application,
0.306     it may be easiest to use pipx install xyz, which will manage a
0.306     virtual environment for you. Make sure you have pipx installed.
0.306
0.306     See /usr/share/doc/python3.12/README.venv for more information.
0.306
0.306 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.306 hint: See PEP 668 for the detailed specification.
------
Dockerfile:11
--------------------
   9 |     	&& rm -rf /var/lib/apt/lists/*
  10 |
  11 | >>> RUN pip install igraph
  12 |
  13 |     RUN apt-get update && apt-get install -y \
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install igraph" did not complete successfully: exit code: 1

So use the package manager to install igraph

@davidrmiller
Copy link
Owner

Hi @obiscr, thanks for this PR. It looks good to me, but I'm not a docker person, so we will appeal to the community for an independent PR review. (Cross-referencing #91.)

Copy link
Contributor

@luiscla27 luiscla27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I made this same PR here, go ahead!

@davidrmiller
Copy link
Owner

Big thanks to @obiscr and @luiscla27 for reporting and confirming this fix.

@davidrmiller davidrmiller merged commit 39e1ce7 into davidrmiller:main Sep 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants