title: PYTHONPATH not working for sudo on GNU/Linux (works for root)
body: <p>EDIT: Works for root, sudo is the problem. Read below.</p>
  
  <p>I have a directory with my own libraries, e.g. my Python libraries are located at <code>/home/name/lib/py</code>.<br>
  I've added this directory to <strong>Python's PATH</strong> for all users (including root) by adding the following line to <code>/etc/bash.bashrc</code>:</p>
  
  <pre><code>export PYTHONPATH=$PYTHONPATH:/home/name/lib/py
  </code></pre>
  
  <p>It works for all users (including root). But it doesn't work for sudo. Is there any way I can make sudo use <code>/etc/bash.bashrc</code>?</p>
  
  <p>EDIT: More information:</p>
  
  <p>I've added <code>PYTHONPATH</code> to sudoers file like so: <code>Defaults env_keep += "HOME PYTHONPATH"</code>. It sitll doesn't work.</p>
  
  <pre><code>env | grep PYTHON:
      PYTHONDONTWRITEBYTECODE=1
      PYTHONPATH=/home/name/lib/py
  
  sudo env | grep PYTHON:
      PYTHONDONTWRITEBYTECODE=1
  
  sudo echo $PYTHONPATH:
      /home/name/lib/py
  </code></pre>