如何通过 pipfile 添加可选依赖项?

问题描述 投票:0回答:1

我知道我可以用常规点做到这一点:

pip install wtforms[email]

但我想在我的 Pipenv 的 pipfile 中执行此操作

wtforms[email] = "*"

这似乎不起作用。我收到此错误:

Found invalid character in key name: '['. Try quoting the key name.

这可以通过 pipfile 实现吗?

python python-3.x pip dependency-management pipenv
1个回答
4
投票

您应该能够做到:

pipenv install wtforms[email]

你还应该能够做到:

wtforms = {version = "*", extras = ["email"]}

我不再使用

Pipenv
,所以我无法测试它,但它应该可以工作。

注:

在 zsh shell 中我必须添加引号,如

pipenv install "wtforms[email]"
.

© www.soinside.com 2019 - 2024. All rights reserved.