title: How to maintain pip install options in requirements file made by pip freeze?
body: <p>I use a <a href="http://www.pip-installer.org/en/latest/requirements.html">pip requirements file</a> to maintain a list of dependencies for my projects.</p>
  
  <p>I now find myself having to install a library using <code>pip install --install-option='some-setup.py.option'</code> <strong>but</strong> <code>pip freeze</code> doesn't record these options in its output which I save in my project's <code>requirements.txt</code>. This causes problems because a simple <code>pip install -r requirements.txt</code> on a new machine installs all the dependencies without supplying the required arguments for this one library, and I've lost the simple round-trip operation.</p>
  
  <p><strong>So, my 2 part question is:</strong></p>
  
  <ul>
  <li>Is there a way to maintain pip install options in the pip freeze output somehow?</li>
  <li>If not, is there a way to manually hack the requirements file to add the install option? I'm ok with losing the round trip nature of <code>pip freeze</code> if I have to, and switching to manual maintenance of the requirements file. I've checked the <a href="http://www.pip-installer.org/en/latest/requirements.html">documentation</a> but couldn't see anything to help.</li>
  </ul>
  
  <p><strong>Unnecessary but possibly interesting details follow</strong></p>
  
  <p>I want to install <a href="http://api.mongodb.org/python/current/">pymongo</a> but <a href="http://api.mongodb.org/python/current/installation.html#installing-without-c-extensions">without building the C extension</a> so I can use it asynchronously in an <a href="http://eventlet.net/">eventlet</a> based app.</p>
  
  <p>Install as desired and build requirements.txt:</p>
  
  <pre><code>(test)day@office:~/test$ pip install pymongo --install-option='--no_ext'
  Downloading/unpacking pymongo
    Downloading pymongo-2.1.1.tar.gz (199Kb): 199Kb downloaded
    Running setup.py egg_info for package pymongo
  Installing collected packages: pymongo
    Running setup.py install for pymongo
  Successfully installed pymongo
  Cleaning up...
  (test)day@office:~/test$ pip freeze &gt;  requirements.txt
  (test)day@office:~/test$ cat requirements.txt
  bottle==0.10.7
  distribute==0.6.10
  eventlet==0.9.16
  greenlet==0.3.3
  lxml==2.3.3
  pymongo==2.1.1
  simplejson==2.3.2
  wsgiref==0.1.2
  </code></pre>
  
  <p>In new virtualenv, try to install same project from <code>requirements.txt</code>. pip builds the C extension for pymongo <code>:(</code></p>
  
  <pre><code>(test2)day@office:~/test2$ pip install -r requirements.txt 
  ...
  Downloading/unpacking pymongo==2.1.1 (from -r requirements.txt (line 6))
    Downloading pymongo-2.1.1.tar.gz (199Kb): 199Kb downloaded
    Running setup.py egg_info for package pymongo
  Installing collected packages: pymongo
    Running setup.py install for pymongo
      building 'bson._cbson' extension
      gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.6 -c bson/_cbsonmodule.c -o build/temp.linux-i686-2.6/bson/_cbsonmodule.o
  ...
  Successfully installed pymongo
  Cleaning up...
  </code></pre>
  
  <p><strong>Update</strong>
  <a href="https://github.com/pypa/pip/issues/271">Issue 271</a> was opened against pip in April 2011 asking for the ability to specify per-line <code>--install-option</code> in requirements.txt. Please vote for the issue if you have the same problem.</p>