How to install python module extras with pip requirements.txt file
<p>The <a href="https://pip.readthedocs.org/en/1.1/requirements.html" rel="noreferrer" title="pip requirements.txt documentation">pip requirements.txt documentation</a> says that extras may be installed using a line like</p>

<pre><code>MyPackage==3.0 [PDF]
</code></pre>

<p>So in my requirements.txt file I have a line that reads:</p>

<pre><code>requests==2.9.1 [security]
</code></pre>

<p>but instead of installing the security extras for the requests module when I run the command:</p>

<pre><code>pip install -r requirements.txt
</code></pre>

<p>I get an error message suggesting that the format of my file is incorrect:</p>

<pre><code>Invalid requirement: 'requests==2.9.1 [security]'
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 77, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "/Library/Python/2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3036, in parse
    req, = parse_requirements(s)
  File "/Library/Python/2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2980, in parse_requirements
    "version spec")
  File "/Library/Python/2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2956, in scan_list
    raise RequirementParseError(msg, line, "at", line[p:])
RequirementParseError: Expected ',' or end-of-list in requests==2.9.1 [security] at  [security]
</code></pre>

<p>Does anyone have any idea what I might be doing wrong?</p>