# CMake Error: Failed to ensurepip

**URL:** https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019
**Category:** Usage
**Tags:** os:windows
**Created:** [February 7, 2024, 3:53am UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019 "2024-02-07T03:53:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![filmtailor-mainframe](https://discourse.cmake.org/user_avatar/discourse.cmake.org/filmtailor-mainframe/32/4280_2.png) [@filmtailor-mainframe](https://discourse.cmake.org/u/filmtailor-mainframe)
#### Post date: [February 7, 2024, 3:53am UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019/1 "2024-02-07T03:53:44Z")

</div>

Hi there,  
I’m trying to build DNEG’s xStudio app, but at the configuration step, am getting the following err:r `Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.  
蝟餌絞?曆??唳?摰?瑼???

CMake Error at CMakeLists.txt:158 (message):  
Failed to ensurepip.

Configuring incomplete, errors occurred!`

When I open the CMakeLists.txt (this is provided as part of the source code [here](https://github.com/mpkepic/xstudio/tree/windows)), it looks like CMake shouldn’t even be running this line (USE\_VCPKG is not checked, so the FATAL\_ERROR “Failed to ensurepip” I would assume not to appear). Is there another step I’m doing wrong?

Thanks!

 ![cmake](https://discourse.cmake.org/uploads/default/original/2X/f/f4ea9bbf4e54a8dcc13dd3d6c216a0310f5bf188.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 7, 2024, 8:42pm UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019/2 "2024-02-07T20:42:48Z")

</div>

Right at the top of the screenshot is a force of `set(USE_VCPKG ON)` which overrides the cache value.

---

<div class="post-metadata">

### Author: ![Ali\_B](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@Ali\_B](https://discourse.cmake.org/u/Ali_B)
#### Post date: [February 8, 2024, 6:02am UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019/3 "2024-02-08T06:02:37Z")

</div>

Hey,

I have ran into this error and a few more that you are likely to run into and it took me days to fix them. Now I’m done the CMake errors and struggling with VS build error.

So for this error in particular, I managed to solve it by manually installing Python 3.10 (3.12 also worked for me) in \build\vcpkg\_installed\x64-windows\tools\Python3

If you run into errors relating to opencolorio or lcms2, let me know

---

<div class="post-metadata">

### Author: ![Giuseppe\_Providenti](https://discourse.cmake.org/user_avatar/discourse.cmake.org/giuseppe_providenti/32/4288_2.png) [@Giuseppe\_Providenti](https://discourse.cmake.org/u/Giuseppe_Providenti)
#### Post date: [February 8, 2024, 2:53pm UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019/4 "2024-02-08T14:53:21Z")

</div>

Hi all,  
i have the same problem but I cannot fix it.  
the error report on console of CMake is:

Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.  
C:\Users\User\Desktop\XStudio\xstudio-windows\build\vcpkg\_installed\x64-windows\tools\python3\python.exe: No module named ensurepip

CMake Error at CMakeLists.txt:158 (message):  
Failed to ensurepip.

Configuring incomplete, errors occurred!

can someone helm me?  
thanks in advance  
Giuseppe

---

<div class="post-metadata">

### Author: ![Ali\_B](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@Ali\_B](https://discourse.cmake.org/u/Ali_B)
#### Post date: [February 8, 2024, 10:48pm UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019/5 "2024-02-08T22:48:52Z")

</div>

> [@Ali\_B](#):
>
> So for this error in particular, I managed to solve it by manually installing Python 3.10 (3.12 also worked for me) in \build\vcpkg\_installed\x64-windows\tools\Python3

Hey, I mentioned this in my last reply and it solved the “Failed to ensurepip” error for me.

So for this error in particular, I managed to solve it by manually installing Python 3.10 (3.12 also worked for me) in \build\vcpkg\_installed\x64-windows\tools\Python3

---

<div class="post-metadata">

### Author: ![MAREYUS](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mareyus/32/4316_2.png) [@MAREYUS](https://discourse.cmake.org/u/MAREYUS)
#### Post date: [February 15, 2024, 10:52pm UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019/6 "2024-02-15T22:52:31Z")

</div>

Thanks! Had the same issue and installing Python manually fixed that error for me. But now I’m getting a new one:

```auto
CMake Error at CMakeLists.txt:176 (find_package):
  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files. If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.

```

---

<div class="post-metadata">

### Author: ![Ali\_B](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@Ali\_B](https://discourse.cmake.org/u/Ali_B)
#### Post date: [February 15, 2024, 11:36pm UTC](https://discourse.cmake.org/t/cmake-error-failed-to-ensurepip/10019/7 "2024-02-15T23:36:55Z")

</div>

> [@MAREYUS](#):
>
> `nlohmann_json_DIR`

No worries. You might have to manually set “nlohmann\_json\_DIR” in cmake. I haven’t run into this error myself but I’ve been fixing similar errors by manually setting the folder path.

Are there any errors prior to this one? Besides the Python error.

Also, after installing python, have you tried deleting the cache and hitting “configure” again?
