2017-02-25 77 views
1

我安裝了下列指南在Windows 10星火: https://simonsuthers.wordpress.com/2017/02/13/how-to-install-spark-on-a-windows-10-machine/問題運行星火10

但是當我嘗試用一​​個簡單的代碼運行Jupyiter筆記本電腦,它給了我下面的錯誤:

NameError: name 'sc' is not defined

而且也是我得到的CMD另一個警告:

'[IPKernelApp] WARNING | Unknown error in handling PYTHONSTARTUP file C:\Spark\bin..\python\pyspark\shell.py:'

但我試圖創建運行於傑普罰款phython功能yiter筆記本。

有人可以幫助理解和解決問題嗎?

回答

2

我得到了同樣的錯誤使用相同的指南。經過幾次嘗試之後,我注意到Anaconda3-4.3.0(本指南中列出的版本)使用Python 3.6,但尚未與Spark一起使用。我繼續前進並卸載了Anaconda3-4.3.0,並安裝了使用Python 3.5的Anaconda3-4.2.0,並修復了錯誤。

0

我有星火2.1(費爾南德斯28,2016)和Windows 10 同樣的問題,當我跑在外殼星火,我得到了錯誤:

The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rw-rw-rw- 

但運行:

winutils.exe chmod 777 D:\tmp\hive 

無法解決問題。

看來這是一個Windows-Spark兼容性問題,它在Spark 2.0.2(2016年11月14日)中解決,但回到2.1.0(Dez 28)。只要運行version 2.0.2解決了我的問題!

Spark 1.6.3也適用於我!

0
Faced same issue in mac and resolved it by following steps: 
1. Uninstall already installed Anaconda3-4.3.0 using below commnand: 
rm -rf ~/anaconda3 
2. Download Anaconda3-4.2.0 from https://repo.continuum.io/archive/Anaconda3-4.2.0-MacOSX-x86_64.sh 
3. Run the above downloaded sh file to install it using cmd : sh Anaconda3-4.2.0-MacOSX-x86_64.sh 
4. Add the below env variables in ~/.bash_profile: 
export PYSPARK_DRIVER_PYTHON=jupyter 
export PYSPARK_DRIVER_PYTHON_OPTS='notebook' 
export PYSPARK_SUBMIT_ARGS="--master local[2]" 
5. Restart your terminal