title: Modifying .bashrc
body: <p>I'm not very familiar with using VIM or bash but I'm trying to get the google gmail API to work.</p>
  
  <p><a href="https://developers.google.com/gmail/api/quickstart/python#step_4_run_the_sample" rel="nofollow">https://developers.google.com/gmail/api/quickstart/python#step_4_run_the_sample</a></p>
  
  <p>At the bottom is has the instructions </p>
  
  <pre><code>AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'
  </code></pre>
  
  <p>This error can occur in Mac OSX where the default installation of the "six" module (a dependency of this library) is loaded before the one that pip installed. To fix the issue, add pip's install location to the PYTHONPATH system environment variable:</p>
  
  <p>Determine pip's install location with the following command:</p>
  
  <pre><code>pip show six | grep "Location:" | cut -d " " -f2
  </code></pre>
  
  <p>When I run this, I get <code>/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python</code></p>
  
  <p>Add the following line your you ~/.bashrc file, replacing  with the value determined above:</p>
  
  <pre><code>export PYTHONPATH=$PYTHONPATH:&lt;pip_install_path&gt;
  </code></pre>
  
  <p>My <code>.bashrc</code> file has 1 line in it: </p>
  
  <p><code>export PYTHONPATH=$PYTHONPATH:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python</code></p>
  
  <p>(There isn't a break between <code>export</code> or the rest, SO is creating the break when I paste it in)</p>
  
  <p>Reload your ~/.bashrc file in any open terminal windows using the following command:</p>
  
  <pre><code>source ~/.bashrc
  </code></pre>
  
  <p>However, when I type <code>cd ~</code> and <code>ls -a</code> I don't see <code>.bashrc</code> only <code>.bash_sessions</code></p>
  
  <p>How do I open and modify <code>.bashrc</code>? </p>
  
  <p>Here is the error file</p>
  
  <pre><code>Installing collected packages: six, httplib2, pyasn1, pyasn1-modules, rsa, oauth2client, simplejson, uritemplate, google-api-python-client
    Found existing installation: six 1.4.1
      DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
      Uninstalling six-1.4.1:
  Exception:
  Traceback (most recent call last):
    File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/basecommand.py", line 209, in main
      status = self.run(options, args)
    File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/commands/install.py", line 317, in run
      prefix=options.prefix_path,
    File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py", line 726, in install
      requirement.uninstall(auto_confirm=True)
    File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_install.py", line 746, in uninstall
      paths_to_remove.remove(auto_confirm)
    File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
      renames(path, new_path)
    File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
      shutil.move(old, new)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
      copy2(src, real_dst)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
      copystat(src, dst)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
      os.chflags(dst, st.st_flags)
  OSError: [Errno 1] Operation not permitted: '/var/folders/0p/503b1d894jz0z8rfyhw6jmzh0000gn/T/pip-xPddj0-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
  </code></pre>
  
  <p>When I run the <code>quickstart.py</code> file:</p>
  
  <pre><code>Morgans-iMac:iMac morganallen$ python quickstar.py 
  Traceback (most recent call last):
    File "quickstar.py", line 73, in &lt;module&gt;
      main()
    File "quickstar.py", line 57, in main
      credentials = get_credentials()
    File "quickstar.py", line 45, in get_credentials
      credentials = tools.run_flow(flow, store, flags)
    File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 135, in positional_wrapper
      return wrapped(*args, **kwargs)
    File "/Library/Python/2.7/site-packages/oauth2client/tools.py", line 199, in run_flow
      authorize_url = flow.step1_get_authorize_url()
    File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 135, in positional_wrapper
      return wrapped(*args, **kwargs)
    File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 1991, in step1_get_authorize_url
      return _update_query_params(self.auth_uri, query_params)
    File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 491, in _update_query_params
      parts = urllib.parse.urlparse(uri)
  AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'
  </code></pre>