Pip install packages that need compilation

Continuing the discussion from Slicer-Python Packages Use and Install:

Hi Andras,
Just checking to see if this is still the case. I am trying to integrate an old C++ code into a scripted module, I converted all to Python and it is using dlib library (dlib · PyPI). I am getting CMake errors from Python Interactor, which I assume related to the above post.

RuntimeError:
*******************************************************************
 CMake must be installed to build the following extensions: dlib
*******************************************************************

Thanks!

1 Like

Yes, for ones that need to be compiled I would suggest to do the method described in this post so that it is compiled and packaged at time of building the extension. The build machine of the extension would then be the one that would need the build requirements.

If you’re curious about if dlib would make prebuilt binaries, you can see the developer’s response at https://github.com/davisking/dlib/issues/2121#issuecomment-653662699.

Of course finding a different python package that can do what you want and has wheels could be another option to avoid a superbuild project.

Thanks, this helps a lot! I think I can find similar functions in opencv.