【发布时间】:2021-04-13 08:59:45
【问题描述】:
我正在尝试安装一个不在 PyPi 上的包。即来自github。将 repo 作为 git+url 添加到需求文件中给出了
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?
安装包完成
RUN python3 -m pip install -r requirements.txt
在docs中指定
我也尝试了this 的解决方案,但答案搞砸了我的其他包。
dockerfile 几乎直接来自文档
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
【问题讨论】:
-
告诉我们你
Dockerfile和requirements.txt!