Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
243 views
in Technique[技术] by (71.8m points)

python - Unable to run pyspark

I installed Spark on Windows, and I'm unable to start pyspark. When I type in c:Sparkinpyspark, I get the following error:

Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "c:Sparkin..pythonpysparkshell.py", line 30, in import pyspark File "c:Sparkpythonpyspark__init__.py", line 44, in from pyspark.context import SparkContext File "c:Sparkpythonpysparkcontext.py", line 36, in from pyspark.java_gateway import launch_gateway File "c:Sparkpythonpysparkjava_gateway.py", line 31, in from py4j.java_gateway import java_import, JavaGateway, GatewayClient File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 646, in _load_unlocked File "", line 616, in _load_backward_compatible File "c:Sparkpythonlibpy4j-0.10.4-src.zippy4jjava_gateway.py", line 18, in File "C:UsersEigenaarAnaconda3libpydoc.py", line 62, in import pkgutil File "C:UsersEigenaarAnaconda3libpkgutil.py", line 22, in ModuleInfo = namedtuple('ModuleInfo', 'module_finder name ispkg') File "c:Sparkpythonpysparkserializers.py", line 393, in namedtuple cls = _old_namedtuple(*args, **kwargs) TypeError: namedtuple() missing 3 required keyword-only arguments: 'verbose', 'rename', and 'module'

what am I doing wrong here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Spark 2.1.0 doesn't support python 3.6.0. To solve this change your python version in anaconda environment. Run following command in your anaconda env

conda create -n py35 python=3.5 anaconda
activate py35

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...