简体   繁体   中英

Apache pig on windows gives “hadoop-config.cmd' is not recognized as an internal or external command” error when running “pig -x local”

If you are stuck at running Apache Pig on windows due to an error like

hadoop-2.4.0\bin\hadoop-config.cmd' is not recognized as an internal or external command,

operable program or batch file.

though you are having Hadoop running perfectly on windows

Answer, which was originally added by the asker inside the quesiton.

These steps may help you.

Troubleshooting steps

  • open the file pig.cmd in any editor like notpad / notepad++
  • look for the line set HADOOP_BIN_PATH=%HADOOP_HOME%\\bin
  • replace this with set HADOOP_BIN_PATH=%HADOOP_HOME%\\libexec

What we did was that hadoop-config.cmd file was not being found by pig so we pointed it with the correct one. You may first find where the hadoop-config.cmd file is and replace it with appropriate path. This was what my hadoop-2.4.0 was having.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM