title: Adding "sudo" before a command makes the command unknown
body: <p>This is a linux problem that's been stumping me for a while. On my work linux box (running RedHat) I was trying to install some Python packages. However, some funny business is occurring, see below:</p>
  
  <ol>
  <li><p>This is my objective and first command </p>
  
  <pre><code>pip install scrapylib
  </code></pre></li>
  <li><p>This creates a 'Permission Denied' error</p>
  
  <pre><code>OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/scrapylib'
  </code></pre></li>
  <li><p>My knee-jerk reaction is to put "sudo" in front of the exact same command...</p>
  
  <pre><code>sudo pip install scrapylib
  </code></pre></li>
  <li><p>That generates this exception,</p>
  
  <pre><code>sudo: pip: command not found
  </code></pre></li>
  <li><p>In order to get around this, I type</p>
  
  <pre><code>sudo su - root
  </code></pre></li>
  <li><p>Now this command runs 100% successfully</p>
  
  <pre><code>pip2.7 install scrapylib
  </code></pre></li>
  <li><p>Finally, I change back to me</p>
  
  <pre><code>sudo su - uspowpow
  </code></pre></li>
  </ol>
  
  <p>Can anyone explain this phenomenon to me? I'm a recent college grad with nothing other than basic Linux knowledge, if someone could explain why placing "sudo" in front of a valid command makes it invalid, I would be extremely grateful (both for the fix and for the knowledge). </p>