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
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.
pip uninstall make
and then brew install make
seems necessary –
Endora 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
I couldnt install qdldl either and found the cmake module was not found error
after a while i noticed that the virtual environment was no active, try activating your virtual environment and then installing cmake in that directory. after that ive opened jupyter labs and tried installing qdldl and it worked.
For macOS users:
brew install cmake
which cmake
# /usr/local/bin/cmake
cmake --version
# cmake version 3.30.3
© 2022 - 2025 — McMap. All rights reserved.
pip uninstall cmake
andbrew install cmake
was needed without the pip install. – Long