title: Pyspark general import problems
body: <p>I succesfully instaled Spark and Pyspark in my machine, added path variables, etc. but keeps facing import problems.</p>
  <p>This is the code:</p>
  <pre><code>from pyspark.sql import SparkSession
  
  spark = SparkSession.builder \
                      .config(&quot;spark.hadoop.hive.exec.dynamic.partition&quot;, &quot;true&quot;) \
                      .config(&quot;spark.hadoop.hive.exec.dynamic.partition.mode&quot;, &quot;nonstrict&quot;) \
                      .enableHiveSupport() \
                      .getOrCreate()
  </code></pre>
  <p>And this is the error message:</p>
  <pre><code>&quot;C:\...\Desktop\Clube\venv\Scripts\python.exe&quot; &quot;C:.../Desktop/Clube/services/ce_modelo_analise.py&quot;
  Traceback (most recent call last):
    File &quot;C:\...\Desktop\Clube\services\ce_modelo_analise.py&quot;, line 1, in &lt;module&gt;
      from pyspark.sql import SparkSession
    File &quot;C:\Spark\spark-2.4.0-bin-hadoop2.7\python\pyspark\__init__.py&quot;, line 51, in &lt;module&gt;
      from pyspark.context import SparkContext
    File &quot;C:\Spark\spark-2.4.0-bin-hadoop2.7\python\pyspark\context.py&quot;, line 31, in &lt;module&gt;
      from pyspark import accumulators
    File &quot;C:\Spark\spark-2.4.0-bin-hadoop2.7\python\pyspark\accumulators.py&quot;, line 97, in &lt;module&gt;
      from pyspark.serializers import read_int, PickleSerializer
    File &quot;C:\Spark\spark-2.4.0-bin-hadoop2.7\python\pyspark\serializers.py&quot;, line 71, in &lt;module&gt;
      from pyspark import cloudpickle
    File &quot;C:\Spark\spark-2.4.0-bin-hadoop2.7\python\pyspark\cloudpickle.py&quot;, line 145, in &lt;module&gt;
      _cell_set_template_code = _make_cell_set_template_code()
    File &quot;C:\Spark\spark-2.4.0-bin-hadoop2.7\python\pyspark\cloudpickle.py&quot;, line 126, in _make_cell_set_template_code
      return types.CodeType(
  
  TypeError: 'bytes' object cannot be interpreted as an integer
  </code></pre>
  <p>If I remove the import line, those problems disappear. As I said before, my path variables are set:</p>
  <p><a href="https://i.stack.imgur.com/zBPKA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zBPKA.png" alt="enter image description here" /></a></p>
  <p>and</p>
  <p><a href="https://i.stack.imgur.com/9Rjz8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Rjz8.png" alt="enter image description here" /></a></p>
  <p>Also, Spark is running correctly in cmd:</p>
  <p><a href="https://i.stack.imgur.com/zA5Kg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zA5Kg.png" alt="enter image description here" /></a></p>