Module_six_moves_urllib_parse object has no attribute urlparse when using plot.ly for Python
<p>I am running below code in Jupyter:</p>

<pre><code>import plotly.plotly as py
import plotly.graph_objs as go

# Create random data with numpy
import numpy as np

N = 100
random_x = np.linspace(0, 1, N)
random_y0 = np.random.randn(N)+5
random_y1 = np.random.randn(N)
random_y2 = np.random.randn(N)-5

# Create traces
trace0 = go.Scatter(
    x = random_x,
    y = random_y0,
    mode = 'markers',
    name = 'markers'
)
trace1 = go.Scatter(
    x = random_x,
    y = random_y1,
    mode = 'lines+markers',
    name = 'lines+markers'
)
trace2 = go.Scatter(
    x = random_x,
    y = random_y2,
    mode = 'lines',
    name = 'lines'
)
data = [trace0, trace1, trace2]

# Plot and embed in ipython notebook!
py.iplot(data, filename='scatter-mode')
</code></pre>

<p>I got error result as:</p>

<blockquote>
  <p>/Library/Python/2.7/site-packages/requests/packages/urllib3/util/ssl_.py:315:
  SNIMissingWarning: An HTTPS request has been made, but the SNI
  (Subject Name Indication) extension to TLS is not available on this
  platform. This may cause the server to present an incorrect TLS
  certificate, which can cause validation failures. For more
  information, see
  <a href="https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning" rel="nofollow noreferrer">https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning</a>.
  SNIMissingWarning
  /Library/Python/2.7/site-packages/requests/packages/urllib3/util/ssl_.py:120:
  InsecurePlatformWarning: A true SSLContext object is not available.
  This prevents urllib3 from configuring SSL appropriately and may cause
  certain SSL connections to fail. For more information, see
  <a href="https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning" rel="nofollow noreferrer">https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning</a>.
  InsecurePlatformWarning
  /Library/Python/2.7/site-packages/requests/packages/urllib3/util/ssl_.py:120:
  InsecurePlatformWarning:</p>
  
  <p>A true SSLContext object is not available. This prevents urllib3 from
  configuring SSL appropriately and may cause certain SSL connections to
  fail. For more information, see
  <a href="https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning" rel="nofollow noreferrer">https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning</a>.</p>
  
  <p>--------------------------------------------------------------------------- AttributeError                            Traceback (most recent call
  last)  in ()
       34 
       35 # Plot and embed in ipython notebook!
  ---> 36 py.iplot(data, filename='scatter-mode')</p>
  
  <p>/Library/Python/2.7/site-packages/plotly/plotly/plotly.pyc in
  iplot(figure_or_data, **plot_options)
      173         embed_options['height'] = str(embed_options['height']) + 'px'
      174 
  --> 175     return tools.embed(url, **embed_options)
      176 
      177 </p>
  
  <p>/Library/Python/2.7/site-packages/plotly/tools.pyc in
  embed(file_owner_or_url, file_id, width, height)
      407         else:
      408             url = file_owner_or_url
  --> 409         return PlotlyDisplay(url, width, height)
      410     else:
      411         if (get_config_defaults()['plotly_domain']</p>
  
  <p>/Library/Python/2.7/site-packages/plotly/tools.pyc in <strong>init</strong>(self,
  url, width, height)    1382         def <strong>init</strong>(self, url, width,
  height):    1383             self.resource = url
  -> 1384             self.embed_code = get_embed(url, width=width, height=height)    1385             super(PlotlyDisplay,
  self).<strong>init</strong>(data=self.embed_code)    1386 </p>
  
  <p>/Library/Python/2.7/site-packages/plotly/tools.pyc in
  get_embed(file_owner_or_url, file_id, width, height)
      313                 "\nRun help on this function for more information."
      314                 "".format(url, plotly_rest_url))
  --> 315         urlsplit = six.moves.urllib.parse.urlparse(url)
      316         file_owner = urlsplit.path.split('/')[1].split('~')[1]
      317         file_id = urlsplit.path.split('/')[2]</p>
  
  <p>AttributeError: 'Module_six_moves_urllib_parse' object has no
  attribute 'urlparse'</p>
</blockquote>

<p>I have tried everything to fix it via this thread</p>

<p><a href="https://stackoverflow.com/questions/29190604/attribute-error-trying-to-run-gmail-api-quickstart-in-python">Attribute Error trying to run Gmail API quickstart in Python</a></p>

<ol>
<li><p>I did the <code>export PYTHONPATH=/Library/Python/2.7/site-packages</code> and make sure I unset it first to blank (yes, that path exists on my Mac).</p></li>
<li><p>I updated <code>w3lib (1.13.0)</code> and <code>six (1.10.0)</code></p></li>
<li><p>Jupyter 4.0.6 and Python 2.7.6</p></li>
</ol>

<p>What else could go wrong? Please help.</p>