今天在运行spark程序时,报错ERROR Shell: Failed to locate the winutils binary in the hadoop binary path

出现这个错误的原因是没有安装hadoop。
首先去hadoop下载链接下载hadoop的压缩包。我打算安装2.10.1版本,下载hadoop-2.10.1.tar.gz。
在这里插入图片描述
由于.tar.gz文件一般都是针对linux系统的,因此我们要在powershell下解压(而不是cmd)。
以管理员模式打开windows自带的powershell,进入压缩包下载路径,输入解压指令,文件名与自己下载的版本有关。这条命令是在当前目录下创建一个同名文件夹,并将压缩包内的文件解压到该文件夹中,更多关于powershell下的解压操作请参考https://blog.csdn.net/qq_42692386/article/details/109181437

tar -zxvf hadoop-2.10.1.tar.gz

解压完之后,hadoop已经安装完成了,此时要添加环境变量。添加系统变量HADOOP_HOME
在这里插入图片描述
并在系统变量的path的最后添加%HADOOP_HOME%\bin。至此环境变量配置完成,在cmd下输入hadoop version测试。

再次运行spark依然报错,最后尝试了博客https://www.cnblogs.com/shenzhenhuaya/p/sdfsdgdfdfdx.html的方法,成功解决,spark程序可以顺利运行了!

GitHub 加速计划 / wi / winutils
2.51 K
3 K
下载
Windows binaries for Hadoop versions (built from the git commit ID used for the ASF relase)
最近提交(Master分支:1 个月前 )
e8089ecf - 1 年前
d4f71517 point people at cdarlint/winutils for binaries and call out the fact that we could remove the need for this entirely just to run spark on windows 5 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐