When I run the command
cmake --version
It gives me the version. But when I run
import cmake
It gives the error cmake module not present.
I am stuck and not getting how to resolve it
For me on MacOSX when I initially install CMake
by pip
, it goes to the similar behaviour.
It was solved by uninstalling CMake
by pip
, and installing CMake
first by brew
before installing by pip
, and before it installing brew
itself, by running in terminal commands from How to run CMake in Mac? answer.
You are talking about two different things:
cmake --version
, you are calling the command line program CMakeimport cmake
in a Python program (or interactive session) you are using the cmake Python module.You are missing the second one. You can install it, e.g. by calling
pip install cmake
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With