0

I am trying to install a package that is not on PyPi. i.e from github. Adding the repo as git+url to the requirements file gives

ERROR: Error [Errno 2] No such file or directory: 'git' while executing command git clone -q https://github.com/Rapptz/discord-ext-menus /tmp/pip-req-build-147rct22
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?

Installing the packages is done with

RUN python3 -m pip install -r requirements.txt

as specified in the docs

I also tried the solutions from this, but the answers mess up my other packages.

The dockerfile is almost directly from the docs

FROM python:3.8-slim-buster

WORKDIR /app

COPY requirements.txt requirements.txt

RUN python3 -m pip install -r requirements.txt

COPY . .

CMD [ "python3", "main.py"]

requirements.txt

asyncpg==0.21.0
git+https://github.com/Rapptz/discord-ext-menus
discord.py==1.7.0
pre-commit==2.10.1
pyclean==2.0.0
pylint==2.6.0
python-dotenv==0.15.0
1
  • 1
    Show us you Dockerfile and requirements.txt! Commented Apr 13, 2021 at 9:02

1 Answer 1

7

As the error tells us, we have to simply install git, so that pip can clone the repo and run the setup file. We can install git with

RUN apt-get update && apt-get install -y git

We also have to build from a python image, the above answer works with python:3.8-slim-buster

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.