Got ModuleNotFoundError: No module named 'cmake' when building on windows #1901
-
Hi comunity, I'm trying to figure out a strange error which only appears on WIndows, not on linux and macos(succeeded github actions run here). The most relevant error message is:
In my setup.py script, cmake is installed using pip at I tried to manually install cmake to PATH (based on a similar question https://stackoverflow.com/questions/74226651/error-in-building-wheel-for-osqp-because-no-module-named-cmake), but it still doesn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
A few quick comments, will try to look at it later: I'd highly recommend looking at scikit-build-core, it's designed to build CMake extension modules. Your approach has several issues. You shouldn't add That said, the problem here is that it seems to be muddling a |
Beta Was this translation helpful? Give feedback.
A few quick comments, will try to look at it later:
I'd highly recommend looking at scikit-build-core, it's designed to build CMake extension modules. Your approach has several issues. You shouldn't add
cmake
andninja
to your build system requirements, as systems like Conda, Linux package managers, etc. do not supply these modules. And you should never importcmake
without having a fallback on a system-installed CMake. Scikit-build-core does this for you correctly. Also, you are usingwheel.bdist_wheel
, which is deprecated (wheel has never claimed to have a public API), and is being moved to setuptools in the next release, and then removed from wheel entirely. Again, scikit-build-core fi…