gpt4 book ai didi

python - SPARK 安装后无法在 MAC 中运行 pyspark

转载 作者:行者123 更新时间:2023-11-30 22:40:07 25 4
gpt4 key购买 nike

我最近使用以下命令在我的 MAC 计算机上安装了 SPARK:

brew install apache-spark

现在我尝试运行pyspark 但它向我显示以下错误。

pyspark

Python 3.6.0 |Anaconda custom (x86_64)| (default, Dec 23 2016, 13:19:00
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last)
File "/usr/local/Cellar/apache-spark/2.1.0/libexec/python/pyspark/shell.py", line 30, in <module>
import pyspark
File "/usr/local/Cellar/apache-spark/2.1.0/libexec/python/pyspark/__init__.py", line 44, in <module>
from pyspark.context import SparkContext
File "/usr/local/Cellar/apache-spark/2.1.0/libexec/python/pyspark/context.py", line 36, in <module>
from pyspark.java_gateway import launch_gateway
File "/usr/local/Cellar/apache-spark/2.1.0/libexec/python/pyspark/java_gateway.py", line 31, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
File "/usr/local/Cellar/apache-spark/2.1.0/libexec/python/lib/py4j-0.10.4-src.zip/py4j/java_gateway.py", line 18, in <module>
File "/Users/hellmaster/anaconda/lib/python3.6/pydoc.py", line 62, in <module>

    import pkgutil
File "/Users/hellmaster/anaconda/lib/python3.6/pkgutil.py", line 22, in <module>
ModuleInfo = namedtuple('ModuleInfo', 'module_finder name ispkg')
File "/usr/local/Cellar/apache-spark/2.1.0/libexec/python/pyspark/serializers.py", line 393, in namedtuple
cls = _old_namedtuple(*args, **kwargs)
TypeError: namedtuple() missing 3 required keyword-only arguments: 'verbose', 'rename', and 'module'

如何解决这个问题?

最佳答案

这是因为 Spark 2.1.0 与 Python 3.6 不兼容。

另请参阅this question .

关于python - SPARK 安装后无法在 MAC 中运行 pyspark,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42945521/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com