github-action
github-action copied to clipboard
Pip -r requirements.txt can't find git?
I need to install a repo from github in pip, however it keeps complaining git not installed Below is my requirements.txt, error message and git action set up. Any help appreciated.
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install git
run: |
sudo apt-get install --assume-yes git
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
Flask-Admin==1.6.1
flask-apispec==0.11.4
Flask-Cors==4.0.0
flask-mongoengine-3 @ git+https://github.com/idoshr/flask-mongoengine.git@3eb8c1ae8d1edcf12df00049eb56e03533c07640
Flask-RESTful==0.3.10
Flask-WTF==1.2.1
gunicorn==21.2.0
#10 [stage-0 2/7] WORKDIR /code
#10 DONE 0.0s
#11 [stage-0 3/7] COPY requirements.txt .
#11 DONE 0.0s
#12 [stage-0 4/7] RUN pip3 install -r requirements.txt
#12 1.991 Collecting flask-mongoengine-3@ git+https://github.com/idoshr/flask-mongoengine.git@3eb8c1ae8d1edcf12df00049eb56e03533c07640 (from -r requirements.txt (line 32))
#12 1.992 Cloning https://github.com/idoshr/flask-mongoengine.git (to revision 3eb8c1ae8d1edcf12df00049eb56e03533c07640) to /tmp/pip-install-bc_rtri1/flask-mongoengine-3_5[114](https://github.com/cutesweetpudding/tovvi_backend/actions/runs/7827436080/job/21355231743#step:12:115)1293258c41298d1cbdc6dd0203b3
#12 1.993 ERROR: Error [Errno 2] No such file or directory: 'git' while executing command git version
#12 1.993 ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
#12 ERROR: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 1
------
> [stage-0 4/7] RUN pip3 install -r requirements.txt:
1.991 Collecting flask-mongoengine-3@ git+https://github.com/idoshr/flask-mongoengine.git@3eb8c1ae8d1edcf12df00049eb56e03533c07640 (from -r requirements.txt (line 32))
1.992 Cloning https://github.com/idoshr/flask-mongoengine.git (to revision 3eb8c1ae8d1edcf12df00049eb56e03533c07640) to /tmp/pip-install-bc_rtri1/flask-mongoengine-3_51141293258c41298d1cbdc6dd0203b3
1.993 ERROR: Error [Errno 2] No such file or directory: 'git' while executing command git version
1.993 ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
------
Dockerfile:10
--------------------
8 | # Install pip requirements.
9 | COPY requirements.txt .
10 | >>> RUN pip3 install -r requirements.txt
11 |
12 | # datadog serverless set up, todo move key to azure env for security
--------------------
ERROR: failed to solve: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 1
Error: The process '/usr/bin/docker' failed with exit code 1
Error: The process '/usr/bin/docker' failed with exit code 1