internet-pi
internet-pi copied to clipboard
Error on: "Task: [Install Docker Compose using Pip]" - Fix here.
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.
On Debian 12, the above change did not work until I also deleted the /usr/lib/python3.11/EXTERNALLY-MANAGED
file.
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
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
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
@danindiana - Please see: https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
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.
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.