title: How to use _repr_html_ with pyspark 2.2 and python 2.7
body: <p><strong><em>I run the following line at my terminal and I got an error, but it works fine in jupyter notebook.</em></strong></p>
  
  <pre><code>df._repr_html_()
  </code></pre>
  
  <blockquote>
    <p>Traceback (most recent call last):
    File "", line 1, in 
    File "/usr/lib/spark/python/pyspark/sql/dataframe.py", line 1020, in <strong>getattr</strong>
    "'%s' object has no attribute '%s'" % (self.<strong>class</strong>.<strong>name</strong>, name))
    AttributeError: 'DataFrame' object has no attribute '_repr_html_'</p>
  </blockquote>