title: Analytics API + Python Server, NotImplementedError Hello Analytics
body: <p>A little background: I've been trying to make a restful server that can query and insert via the management API.  After banging my head against the wall using node.js and javascript I switched over to python knowing it has more support. </p>
  
  <p>Currently I am trying to follow the GA <a href="https://developers.google.com/analytics/solutions/articles/hello-analytics-api">Tutorial: Hello Analytics API</a> with a slight twist. I trigger the what was the <code>main</code> method in <code>hello_analytics_api_v3.py</code> when trying to access a particular end point on the server.  This is only for testing. The method is called <code>insertExperiment</code> and attempts to insert an experiment into a private Google Analytics account.</p>
  
  <p>However I'm always receiving the exception:
  <code>NotImplementedError('The gflags library must be installed to use tools.run(). Please install gflags or preferrably switch to using tools.run_flow().',)</code></p>
  
  <p>Here is the full trace stack:</p>
  
  <blockquote>
    <p>File "/0zzz/bottle.py", line 764, in _handle </p>
  
  <pre><code>return route.call(**args) 
  </code></pre>
    
    <p>File "/0zzz/bottle.py", line 1575, in wrapper </p>
  
  <pre><code>rv = callback(*a, **ka) 
  </code></pre>
    
    <p>File "server.py", line 39, in server_static </p>
  
  <pre><code>hello_analytics_api_v3.insertExperiment("xxxxxxx", "xxxxxxxxx", "xxxxxx", experiment_body) 
  </code></pre>
    
    <p>File "/0zzz/hello_analytics_api_v3.py", line 11, in insertExperiment</p>
  
  <pre><code>service = hello_analytics_api_v3_auth.initialize_service() 
  </code></pre>
    
    <p>File "/0zzz/hello_analytics_api_v3_auth.py", line 32, in
    initialize_service </p>
  
  <pre><code>credentials = prepare_credentials() 
  </code></pre>
    
    <p>File "/0zzz/hello_analytics_api_v3_auth.py", line 25, in
    prepare_credentials </p>
  
  <pre><code>credentials = run(FLOW, storage) 
  </code></pre>
    
    <p>File "/0zzz/oauth2client/tools.py", line 241, in run </p>
  
  <pre><code>'The gflags library must be installed to use tools.run(). ' 
  </code></pre>
    
    <p>NotImplementedError: The gflags library must be installed to use
    tools.run(). Please install gflags or preferrably switch to using
    tools.run_flow().</p>
  </blockquote>
  
  <p><strong>A few extra notes:</strong> </p>
  
  <ul>
  <li>I have tried this exact same thing (invoking <code>main</code> on pinging the correct address) when copying the exact code from the Tutorial.</li>
  <li>I have write access with the management API -- so that's not a problem here at all.</li>
  <li>I thought there might be a namespace issue with one of my libraries (which also imports a <code>run</code>) but resolved this by renaming the other library. </li>
  <li>GA Client Library is installed! as per the instructions on <a href="https://developers.google.com/analytics/solutions/articles/hello-analytics-api">Hello Analytics API</a>.</li>
  </ul>
  
  <p>Thank you for any help you can provide!</p>