ModuleNotFoundError: No module named 'cmake'

That right there is the problem. When you call cmake on your shell, the executable ~/.local/bin/cmake is used instead of /usr/bin/cmake. For cmake to work, the exec needs to be inside the root of the cmake installation. In your case, cmake is installed globally using pacman, so it will only work if /usr/bin/cmake is used.

For now, I recommend 2 options:

  1. Remove ~/.local/bin/ from your PATH variable
  2. Put ~/.local/bin to the end of your PATH variable instead of putting it in front. We want the system to find the global cmake first, not the local cmake exec inside your home directory.

I don’t know how the cmake executable got inside your ~/.local/bin/ directory, that’s a mystery to be cleared up later, hopefully.

2 Likes