Question: I could run PySpark from the terminal line and everything works fine.

```
~/spark-1.0.0-bin-hadoop1/bin$ ./pyspark

```

Welcome to

```

      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 1.0.0
      /_/

```

Using Python version 2.7.6 (default, May 27 2014 14:50:58)

However when I try to this on a Python IDE

```
import pyspark

```

> 
> ImportError: No module named pyspark
> 
> 
> 

How do I import it like other Python libraries such numpy, scikit etc.?

Working in the terminal works fine, I just wanted to work in the IDE.

Answer: 
Thanks [Ophir YokTon](https://stackoverflow.com/users/590335/ophir-yoktan)'s upper post, I Finally managed to do it with "Spark 1.4.1+ Spyder2.3.4.

Here I would like to give one summary on all my steps to do it, hope it can help some people in the similiar situations. 

1. Add PYTHONPATH variable into .bashrc. (of course you can put into other relavent profile file)

> 
> 
> ```
> export PYTHONPATH=$SPARK_HOME/python/:$PYTHONPATH
> 
> export PYTHONPATH=$SPARK_HOME/python/lib/py4j-0.8.2.1-src.zip:$PYTHONPATH
> 
> ```
> 
> 

2. Make it effective by

> 
> 
> ```
> source .bashrc
> 
> ```
> 
> 

3. Create one copy of spyder as spyder.py on your spyder bin directory

> 
> 
> ```
> cp spyder spyder.py
> 
> ```
> 
> 

4. Start Spyder IDE with following command

> 
> 
> ```
> spark-submit spyder.py
> 
> ```
> 
> 

I implemented [the sample "simple app" from apache spark](https://spark.apache.org/docs/latest/quick-start.html) and passed the running test it in spyder environment. please refer to the picture "<http://i.stack.imgur.com/xTv6s.gif>"
1. If you just want to import the module , adding it to python path is enough
2. If you want to run complete scripts from the IDE, you can create a 'tool' that uses spark-submit to execute your script from the IDE (instead of normal run)
3. Specifically for spyder (or other IDE's that are written in python) you can run the IDE from within spark-submit

example:

```
spark-submit.cmd c:\Python27\Scripts\spyder.py

```

* note that I had to rename spyder to spyder.py - it appears spark submit relies on the extension do distinguish between python, java, or scala
* add any required parameters to spark-submit