为什么我不能在`pipenv install --dev`后运行开发依赖项?

Rob*_*bin 8 python pipenv

我的项目django-heroku在它的 Pipfile 中有一个package.

django-heroku具有gunicorn在其Pipfile作为dev-package。见:https : //github.com/heroku/django-heroku/blob/master/Pipfile

我希望pipenv install --dev在我的项目中运行后,我可以运行pipenv run gunicorn.

但它抛出以下错误:

Error: the command gunicorn could not be found within PATH or Pipfile's [scripts].

如果开发依赖项不可用,那有什么意义install --dev

Nic*_*asM 8

一个答案是包 X 的“开发依赖项”是某人在开发(而不是使用)包 X 时需要的包。

我希望在我的项目中运行 pipenv install --dev 后,...

如果您pipenv install --dev项目中使用, pipenv 应该安装开发项目所需的所有包。

如果它一直向下递归安装所有开发依赖项,它可能会引入其他包开发所需的 Python 分析包、测试运行器等。这些不一定适合开发您的项目的人。

例如,如果我的项目列为pytestdev 依赖项,我会对pipenvinstalled不满意nose,这可能会在其他一些过时的包中列为 dev 依赖项。

如果您的包的开发人员需要gunicorn,您应该将其明确列为项目的开发依赖项。