電腦已經裝了anaconda python,而後下載了spark2.1.0。由於版本太新,因此網上和書上的一些內容已經再也不適用。好比關於如何使用IPython和Jupyter,教程給出的方法是用以下語句打開Spark便可進入IPython或者IPython Notebook:python
IPYTHON=1 ./bin/pyspark IPYTHON_OPTS="notebook" ./bin/pyspark
然鵝運行以上語句後我獲得的是:bash
Error in pyspark startup: IPYTHON and IPYTHON_OPTS are removed in Spark 2.0+. Remove these from the environment and set PYSPARK_DRIVER_PYTHON and PYSPARK_DRIVER_PYTHON_OPTS instead.
因此使用Jupyter打開Spark的設置方法是:spa
1 export PYSPARK_DRIVER_PYTHON=jupyter 2 export PYSPARK_DRIVER_PYTHON_OPTS='notebook' pyspark
這樣再打開Spark時就會自動使用Jupyter Notebook來打開Spark了。code