ERROR: /bin/sh: cmake command not found on MacOS

Error Message screencap

Got this error running Conan on MacOS, trying to build a package that required opencv 4.5.0 to build from source.

On first glance it looks like OpenCV is messed up or maybe conan but if I look up past all the red text I can see the real original cause of the issue. The red text is just a cascading consequence of this original error message.

For this reason, I do advise not to stop reading a log at the first error message you find, but instead to try to see if there is some cascading effect and to see if you can find the top of the stack to get at the original cause.

was the cause.

So here’s the deal,

when I do cmake in my normal interactive terminal I can find cmake no problem,

but, check this out:

So yeah, that’s kind of weird, my shell can apparently find cmake but /bin/sh cannot.

Instead of adding to the path in ~/.bash_profile I decide to go a little deeper down,

to open up the paths file for MacOS

add

to the path at the end.

Note: this assumes you have the CMAKE GUI app installed, substitute your own path to whatever cmake you have.

Open a new terminal and voila, the issue is fixed.

Research and Development | Dev Ops | Software Engineer | Topaz Labs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store