pycharm: How do I import pyspark to pycharm
<p>I have done quite some spark job in Java/Scala, where I can run some test spark job directly from main() program, as long as I add the required spark jar in the maven pom.xml.</p>

<p>Now I am starting to work with pyspark. I am wondering if I could do something similar? For example, I am using pycharm to run a the wordCount job:</p>

<p><a href="https://i.stack.imgur.com/sXxti.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sXxti.png" alt="enter image description here"></a></p>

<p>If I just run the main() program, I got the following error:</p>

<pre><code>Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/profiler/run_profiler.py", line 145, in &lt;module&gt;
    profiler.run(file)
  File "/Applications/PyCharm.app/Contents/helpers/profiler/run_profiler.py", line 84, in run
    pydev_imports.execfile(file, globals, globals)  # execute the script
  File "/Users/edamame/PycharmProjects/myWordCount/myWordCount.py", line 6, in &lt;module&gt;
    from pyspark import SparkContext
ImportError: No module named pyspark

Process finished with exit code 1
</code></pre>

<p>I am wondering how do I import pyspark here? so I could run some test job from the main() program like I did in Java/Scala.</p>

<p>I also tried to edit the interpreter path:
<a href="https://i.stack.imgur.com/ajRiu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ajRiu.png" alt="enter image description here"></a></p>

<p>and my screenshot from Run -> Edit Configuration:</p>

<p><a href="https://i.stack.imgur.com/TgP7l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TgP7l.png" alt="enter image description here"></a></p>

<p>Last is my project structure screen shot:
<a href="https://i.stack.imgur.com/2yIVT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2yIVT.png" alt="enter image description here"></a></p>

<p>Did I miss anything here? Thanks!</p>