title: Can't import module when using root user
body: <p>What should I do if I can import a module when I run python, but not when I run sudo python?</p>
  
  <p>For example:</p>
  
  <pre><code>whoami
      rose
  python
  &gt;&gt;&gt; import mymodule
  &gt;&gt;&gt;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>sudo python
  &gt;&gt;&gt; import mymodule
  Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: No module named mymodule
  </code></pre>
  
  <p>I had run <code>sudo chown -R rose:rose</code> on the package containing this module.</p>
  
  <p><code>sudo which python</code> and <code>which python</code> both print <code>/usr/bin/python</code>.</p>
  
  <p>I'm running Linux.</p>