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

Error on: "Task: [Install Docker Compose using Pip]" - Fix here. #558

Closed
hockeygoalie35 opened this issue Oct 31, 2023 · 7 comments
Closed
Labels

Comments

@hockeygoalie35
Copy link

hockeygoalie35 commented Oct 31, 2023

Hi, so due to an issue with PyYAML5.4.1, the wheel for PyYAMLcan't be built. This is due to an issue with v5.4.1. This issue was apparenly caused by an incompatibility of PyYAML<6.0.1 compiled under the version of Cython>=3.0.

The Fix: Change docker.yml starting at line 52 in the Tasks folder:

name: Install Docker Compose using Pip.
  ansible.builtin.pip:
    name: 
      - pyyaml==5.3.1
      - docker-compose
    state: present
    executable: pip3

This ensures the previous version of PyYAML is pulled until 6.0.1 is released.

@tonythell
Copy link

On Debian 12, the above change did not work until I also deleted the /usr/lib/python3.11/EXTERNALLY-MANAGED file.

@stevesirois
Copy link

stevesirois commented Nov 24, 2023

Hi, for me the error on that step was:

fatal: [172.16.1.142]: FAILED! => {"changed": false, "cmd": ["/usr/bin/pip3", "install", "pyyaml==5.3.1", "docker-compose"], "msg": "\n:stderr: error: externally-managed-environment\n\n× This environment is externally managed\n╰─> To install Python packages system-wide, try apt install\n python3-xyz, where xyz is the package you are trying to\n install.\n \n If you wish to install a non-Debian-packaged Python package,\n create a virtual environment using python3 -m venv path/to/venv.\n Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n sure you have python3-full installed.\n \n If you wish to install a non-Debian packaged Python application,\n it may be easiest to use pipx install xyz, which will manage a\n virtual environment for you. Make sure you have pipx installed.\n \n See /usr/share/doc/python3.11/README.venv for more information.\n\nnote: 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.\nhint: See PEP 668 for the detailed specification.\n"}

So I decided to be wild and pass --break-system-packages so the entries look like that now:

name: Install Docker Compose using Pip.
  ansible.builtin.pip:
    name: 
      - pyyaml==5.3.1
      - docker-compose
      - --break-system-packages
    state: present
    executable: pip3

It work!

PS: My Pi OS is Ubuntu Server 23.10

@explodeo
Copy link

This fixed the problem for me (Debian 12):

$ pip3 install "cython<3.0.0" wheel --break-system-packages
$ pip3 install pyyaml==5.4.1 --no-build-isolation  --break-system-packages
$ pip3 install docker-compose

@danindiana
Copy link

pip3 install docker-compose

Tried this for RPI5 but didn't work still get:

TASK [Install Docker Compose using Pip.] **********************************************************************************************************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["/usr/bin/pip3", "install", "docker-compose"], "msg": "\n:stderr: error: externally-managed-environment\n\n× This environment is externally managed\n╰─> To install Python packages system-wide, try apt install\n python3-xyz, where xyz is the package you are trying to\n install.\n \n If you wish to install a non-Debian-packaged Python package,\n create a virtual environment using python3 -m venv path/to/venv.\n Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n sure you have python3-full installed.\n \n For more information visit http://rptl.io/venv\n\nnote: 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.\nhint: See PEP 668 for the detailed specification.\n"}

PLAY RECAP ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
localhost : ok=6 changed=0 unreachable=0 failed=1 skipped=4 rescued=0 ignored=0

@geerlingguy
Copy link
Owner

@danindiana - Please see: https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3

Copy link

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@github-actions github-actions bot added the stale label Apr 22, 2024
Copy link

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants