title: Mac - Python - import error: "No module named site"
body: <p>Tonight I am trying to get the package called "requests" installed and have begun fumbling around with the terminal and do not have very much intuition when it comes to this sort of thing.  </p>
  
  <p>Computer is a mac mini, osx version 10.9.4</p>
  
  <p>In /Library/Python I have 4 folders: 2.3 2.5 2.6 and 2.7.<br>
  In /Applications I have "Python 2.7" and "Python 3.4"<br>
  I can open IDLE and type 8+8 and I get 16 just fine.     </p>
  
  <p>Here is the error I am getting in terminal:     </p>
  
  <pre><code> host-210-117:~ Mario$ python       
   ImportError: No module named site       
  
   host-210-117:~ Mario$ pip       
   ImportError: No module named site      
  </code></pre>
  
  <p>My goal is to run this command in the terminal:     </p>
  
  <pre><code> pip install requests
  </code></pre>
  
  <p>I believe pip is already installed.  I run the file "get-pip.py" in IDLE and this is what it says:</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
  <pre><code> Requirement already up-to-date: pip in /Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg
   Cleaning up...
  </code></pre>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>This may have something to do with paths?  I would appreciate some guidance/hints/tips, thanks!</p>
  
  <p>Oh and just a little more info that might help solve this question.  Here is the first few lines of the program I'm running:</p>
  
  <pre><code> import base64
   import hmac
   import json
   import requests
   import time
   import urllib
   import os
  </code></pre>
  
  <p>Which gives me this error in IDLE (so I guess it importing those first few packages with no problem?) :</p>
  
  <pre><code> &gt;&gt;&gt; 
  
   Traceback (most recent call last):
     File "/Users/Mario/Desktop/pyak/pyak.py", line 4, in &lt;module&gt;
       import requests
   ImportError: No module named requests
   &gt;&gt;&gt; 
  </code></pre>
  
  <p>*****  System path list:</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>sys.path
        ['/Users/Mario/Desktop/pyak', '/Users/Mario/Documents', '/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages']</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>*** another update:</p>
  
  <pre><code> host-210-117:~ Mario$ which python      
   /Library/Frameworks/Python.framework/Versions/2.7/bin/python
  </code></pre>
  
  <p>*** a little more info (is this supposed to happen?)</p>
  
  <pre><code> host-210-117:~ Mario$ which pip       
   /usr/local/bin/pip        
   host-210-117:~ Mario$ pip       
   ImportError: No module named site       
  </code></pre>
  
  <p>*** After changing .bashrc</p>
  
  <p>.bashrc: here's what in the file        </p>
  
  <p>export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting<br>
  alias python=/Library/Python/2.7/python</p>
  
  <p>here is the output of running:       </p>
  
  <pre><code>  pip install requests      
  </code></pre>
  
  <p>host-210-117:~ Mario$ pip install requests<br>
  Downloading/unpacking requests<br>
    Downloading requests-2.4.1-py2.py3-none-any.whl (458kB): 458kB downloaded<br>
  Installing collected packages: requests<br>
  Cleaning up...<br>
  Exception:<br>
  Traceback (most recent call last):<br>
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
      status = self.run(options, args)<br>
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
      requirement_set.install(install_options, global_options, root=options.root_path)<br>
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
      requirement.install(install_options, global_options, *args, **kwargs)<br>
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install
      self.move_wheel_files(self.source_dir, root=root)
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 901, in move_wheel_files
      pycompile=self.pycompile,<br>
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files
      clobber(source, lib_dir, True)<br>
    File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 205, in clobber
      os.makedirs(destdir)<br>
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
      mkdir(name, mode)<br>
  OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/requests'        </p>
  
  <p>Storing debug log for failure in /Users/Mario/Library/Logs/pip.log</p>