title: ModuleNotFoundError: No module named 'py4j'
body: <p>I installed Spark and I am running into problems loading the pyspark module into ipython. I'm getting the following error:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>ModuleNotFoundError                       Traceback (most recent call last)
  &lt;ipython-input-2-49d7c4e178f8&gt; in &lt;module&gt;
  ----&gt; 1 import pyspark
  
  /opt/spark/python/pyspark/__init__.py in &lt;module&gt;
       44 
       45 from pyspark.conf import SparkConf
  ---&gt; 46 from pyspark.context import SparkContext
       47 from pyspark.rdd import RDD
       48 from pyspark.files import SparkFiles
  
  /opt/spark/python/pyspark/context.py in &lt;module&gt;
       27 from tempfile import NamedTemporaryFile
       28 
  ---&gt; 29 from py4j.protocol import Py4JError
       30 
       31 from pyspark import accumulators
  
  ModuleNotFoundError: No module named 'py4j'</code></pre>
  </div>
  </div>
  </p>