解决Storm启动错误-bash: ./bin/storm: /usr/bin/python: bad interpreter: No such file or directory

在使用大数据Storm流计算框架时,执行命令 ./bin/storm nimbus,出现如下错误:
解决Storm启动错误-bash: ./bin/storm: /usr/bin/python: bad interpreter: No such file or directorybash: ./bin/storm: /usr/bin/python: bad interpreter: No such file or directory

网上有很多解决方案,但基本都是yum的,没有关于storm这个类型的错误。

于是我只好自己探索解决方案了。

错误原因是找不到/usr/bin目录中的python

于是去/usr/bin查看一下,执行命令:ll /usr/bin | grep 'python’
解决Storm启动错误-bash: ./bin/storm: /usr/bin/python: bad interpreter: No such file or directory可以看到在/usr/local目录下有很多python版本,但就是没有python这个可执行文件

于是,切换storm的可执行文件。

在storm安装目录中执行命令:vim ./bin/storm
修改其中第一行的内容:指定python版本,这里我使用了python3.6版本
解决Storm启动错误-bash: ./bin/storm: /usr/bin/python: bad interpreter: No such file or directory修改完成。

说实话,我没有看懂,但看着挺像的,试试呗。

保存退出后,重新执行命令:./bin/storm nimbus
解决Storm启动错误-bash: ./bin/storm: /usr/bin/python: bad interpreter: No such file or directory
结果真就成功了~