title: requirements.txt - How to mark alternative packages
body: <p>I am writing a project that relies on <code>tensorflow</code>, but that can be provided by either of two <code>pip</code> packages: <code>tensorflow</code> or <code>tensorflow-gpu</code>. My project works fine with either, but I don't want people running it on a machine without gpu support to have to install the extra overhead, but I still want people running on machines with gpu support to be able to leverage that. Is there a way to mark in my <code>requirements.txt</code> file that I require <em>either</em> <code>tensorflow</code> <em>or</em> <code>tensorflow-gpu</code> but not both?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>In this specific case I should note that from the <em>programmer's</em> point of view, both <code>tensorflow</code> and <code>tensorflow-gpu</code> are identical, as they both provide a module <code>tensorflow</code> which has the same functions/classes/methods etc., and only differ in that <code>tensorflow-gpu</code> benefits from GPU acceleration. The problem that I am having is that if I put <code>tensorflow</code> in <code>requirements.txt</code> then in order to run with GPU acceleration, users would have to do <code>pip install -r requirements.txt &amp;&amp; pip uninstall tensorflow &amp;&amp; pip install tensorflow-gpu</code> which is not ideal, and if I instead put <code>tensorflow-gpu</code> in <code>requirements.txt</code>, then it will require a bunch of unnecessary system libraries (CUDNN etc) and wont work out-of-the-box for non-gpu users.</p>
  
  <p><strong>EDIT AGAIN</strong></p>
  
  <p>As a work-around, I've decided to provide two different requirement files, <code>requirements.txt</code> and <code>requirements-gpu.txt</code>, both of which include a shared <code>-r .requirements-core.txt</code> and add their respective version of tensorflow. That way people who want GPU support can <code>pip install -r requirements-gpu.txt</code> but the standard <code>pip install -r requirements.txt</code> will still work out-of-the box for everyone.</p>