TypeError:an integer is required(got type bytes) 因为spark还不支持python3.8,所以需要将python版本将到3.7以下,本次我用了python3.6.6,完美解决
File"/opt/module/spark/python/pyspark/cloudpickle.py", line127,in_make_cell_set_template_codereturntypes.CodeType( TypeError: an integerisrequired (got type bytes) 解决办法:降低pyspark使用的python版本。可以更改系统默认python版本,也可以在spark-env.sh中添加如 export PYSPARK_PYTHON=/usr/bin/python2....
下载完后运行 错误4TypeError: an integer is required (got type bytes) 上网查找原因他们说 spark2.4.4不支持python3.8,只需要另外安装python3.8一下的版本。选择python3.8以下的解释器运行这个文件就可以了 关于如何安装python可以参考别的博客 () 接着一顿操作,安装完python,重新配置linux下的python环境。选择python...
here is my attempt: from pyspark.sql.functions import pandas_udf, PandasUDFType stringSchema = StructType([ StructField("fixedRoute", StringType(), False), StructField("accuracy", IntegerType(), False)]) @pandas_udf(stringSchema) def stringClassifier(x,y,z): ... do some code return (...
pyspark 如果是 2.4.x 版本以及 python 环境是 3.8 时,会报 TypeError: an integer is required (got type bytes) 错误,那如何 fix 该 error 呢。 1错误信息 2原因及解决方法 错误信息 错误信息可能如下: Traceback (most recent call last): File "/xxx/xxx/xxx.py", line 2, in <module> from ...
对于较新的python版本,您可以尝试,作为一个不好的解决方案,可以使用_make_cell_set_template_code函数...
TypeError:an integer is required (got type bytes)? 这个问题在我看来就是python版本的问题,在之前的3.8中有出现 总结 pyspark在windows环境下的安装,最重要的就是版本兼容问题,只要将版本弄好,按正常流程下来是没问题的。版权声明:本文为qq_41270407原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接...
pyspark:TypeError:an integer is required(got type bytes): 小结: 安装python;安装spark;把spark的python文件夹下pyspark文件夹复制放到本机python目录的lib/site-scripts安装hadoop及winutils.exe;安装jupyter;安装py4j 3.8版本用不了,卸载重装3.7 https://blog.csdn.net/weixin_43645287/article/details/109776235 ...