Search code examples
pythonpython-3.xpipdependency-managementpipenv

How do I add optional dependencies through pipfile?


I know I can do this is with regular pip:

pip install wtforms[email]

But I want to do this in my pipfile for pipenv

wtforms[email] = "*"

Which doesn't seem to work. I get this error:

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

Is this possible through the pipfile?


Solution

  • You should be able to do: pipenv install wtforms[email].

    And you should also be able to do:

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

    I don't use Pipenv anymore, so I cannot test it, but it should work.

    Note:

    iin zsh shell I had to add quotes like pipenv install "wtforms[email]" .