Django:Pipfile.lock依赖项安装问题

时间:2020-06-10 07:33:46

标签: python django docker pip pipenv

我正在Django项目(在Docker中)上工作,并使用pipenv来安装各种软件包。在安装最新的软件包时,我使用了一个错误 docker-compose exec web pipenv install dateutil而不是python-dateutil,这是正确的软件包名称。

发生的事情是安装失败,并显示一条消息,提示没有该名称的软件包。不过dateutil出现在我的pipfile中。因此,我尝试通过docker-compose exec web pipenv uninstall dateutil从文件中删除它,由于未安装该软件包,因此无法正常工作。我继续,只是从我的pipfile中删除了dateutil,并用正确的名称安装了python-dateutil

当我之后尝试重建映像时,出现以下错误消息:

Installing dependencies from Pipfile.lock (789763)…
remote: Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/bin/python: not found
remote:
remote: Output:
remote: Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/bin/python: not found
remote:
remote: Output:
remote: Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/bin/python: not found
remote:
remote: Output:
remote: Removing intermediate container 84c77fef6192
remote:  ---> 109aa5618fd4
remote: Step 8/8 : COPY . /code/
remote:  ---> 5afe012dfe80
remote: Successfully built 5afe012dfe80
remote: Successfully tagged 3c44f0505a52f77469b72b43bc40afe49fed878e:latest

我的应用仍然可以(在本地和生产环境中使用),但是我想了解(1)解决此类事件的正确方法是什么,以及(2)是否有解决方法(=获取在事件发生后消除每次我重新标记图像的错误消息)

1 个答案:

答案 0 :(得分:0)

我已降级为pipenv 2018.11.26

sudo python -m pip install pipenv==2018.11.26