# Windows Nightly build error: pip install of SimpleITK build failing

**URL:** <https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629>\
**Category:** Development\
**Created:** [October 10, 2022, 7:50pm UTC](https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629 "2022-10-10T19:50:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [October 10, 2022, 7:50pm UTC](https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629/1 "2022-10-10T19:50:08Z")

</div>

Between [Oct 7](https://slicer.cdash.org/index.php?project=SlicerPreview&date=2022-10-07&filtercount=2&showfilters=1&filtercombine=and&field1=groupname&compare1=63&value1=Nightly-Packages&field2=buildname&compare2=63&value2=Windows) and [Oct 8](https://slicer.cdash.org/index.php?project=SlicerPreview&date=2022-10-08&filtercount=2&showfilters=1&filtercombine=and&field1=groupname&compare1=63&value1=Nightly-Packages&field2=buildname&compare2=63&value2=Windows), the installation of SimpleITK from its build tree started to fail.

Notes:

- The commits [introduced](https://github.com/Slicer/Slicer/compare/f898ebd7...60f774) between these two dates are likely unrelated.
- The error can **NOT** be reproduced by locally running `cmake.exe -P D:\D\P\S-0-build\SimpleITK_install_step.cmake`
  - Running from the windows terminal with current drive being either `C:` or `D:` does **not** allow to reproduce.
  - Removing the `SimpleITK-*` directories from `D:\D\P\S-0-build\python-install\Lib\site-packages` does **not** allow to reproduce.

The associated error (logged into file `SimpleITK_install_step_error.txt`) is the copied below.

```auto
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
    ERROR: Command errored out with exit status 1:
     command: 'D:\D\P\S-0-build\python-install\bin\python.exe' -c 'import io, os, sys, setuptools, tokenize sys.argv[0] = '"'"'C:\\Users\\svc-dashboard\\AppData\\Local\\Temp\\pip-req-build-28m_6mgt\\setup.py'"'"' __file__ ='"'"'C:\\Users\\svc-dashboard\\AppData\\Local\\Temp\\pip-req-build-28m_6mgt\\setup.py'"'"'f = getattr(tokenize, '"'"'open'"'"', open)( __file__ ) if os.path.exists( __file__ ) else io.StringIO('"'"'from setuptools import setup setup()'"'"')code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"')f.close()exec(compile(code, __file__ , '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\svc-dashboard\AppData\Local\Temp\pip-pip-egg-info-r_1drybq'
         cwd: C:\Users\svc-dashboard\AppData\Local\Temp\pip-req-build-28m_6mgt\
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\svc-dashboard\AppData\Local\Temp\pip-req-build-28m_6mgt\setup.py", line 20, in <module>
        doc_files = [to_package_relpath(f) for f in [r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/LICENSE',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/NOTICE',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/Readme.md',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/ITK-5.3-NOTICE',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/ITK-5.3-README.md']]
      File "C:\Users\svc-dashboard\AppData\Local\Temp\pip-req-build-28m_6mgt\setup.py", line 20, in <listcomp>
        doc_files = [to_package_relpath(f) for f in [r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/LICENSE',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/NOTICE',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/Readme.md',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/ITK-5.3-NOTICE',r'D:/D/P/S-0-build/SimpleITK-build/SimpleITK-build/Wrapping/Python/SimpleITK/docs/ITK-5.3-README.md']]
      File "C:\Users\svc-dashboard\AppData\Local\Temp\pip-req-build-28m_6mgt\setup.py", line 18, in to_package_relpath
        return osp.relpath(filename, osp.join(os.curdir, pkg_name))
      File "D:\D/P/S-0-build/python-install\Lib\ntpath.py", line 703, in relpath
        raise ValueError("path is on mount %r, start on mount %r" % (
    ValueError: path is on mount 'D:', start on mount 'C:'

```

Related postings:

- [https://forum.image.sc/t/valueerror-path-is-on-mount-d-start-on-mount-c/69746](https://forum.image.sc/t/valueerror-path-is-on-mount-d-start-on-mount-c/69746)
- Problem was reported back 2021 in [pypa/pip#7625](https://github.com/pypa/pip/issues/7625) fixed by pull request [pypa/pip#8062](https://github.com/pypa/pip/pull/8062)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 10, 2022, 9:00pm UTC](https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629/2 "2022-10-10T21:00:13Z")

</div>

The SimpleITK issue occurred on some earlier dates as well.  
[CDash](https://slicer.cdash.org/viewBuildError.php?buildid=2814131) 2022-09-30  
[CDash](https://slicer.cdash.org/viewBuildError.php?buildid=2816855) 2022-10-03

[COMP: Update ITK to post-v5.3rc04 version and SimpleITK to post-v2.2.0 · Slicer/Slicer@4d1c98e · GitHub](https://github.com/Slicer/Slicer/commit/4d1c98ef8f9623cc4ef175b9dc734e9540bd9f02) did include a change to use pip to install SimpleITK rather than using setup.py which was based on corresponding change at [Use pip to install SimpleITK · SimpleITK/SimpleITK@3ce91db · GitHub](https://github.com/SimpleITK/SimpleITK/commit/3ce91dbcb19b6ad502abbaee03b06ceaa9a9db69). That would be my best suspicion about why it would’ve started to randomly occur.

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [October 10, 2022, 9:07pm UTC](https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629/3 "2022-10-10T21:07:59Z")

</div>

This has been happening intermittently for a while, I thought I had sorted it out earlier when I fixed the nightly build not being cleaned correctly.

> [@Slicer build error on Windows dashboard](https://discourse.slicer.org/t/slicer-build-error-on-windows-dashboard/25376/3):
>
> Coming back to this, it looks like a number of issues were occurring on the factory machine, most notably that the build directory was not being cleaned before the nightly build, which can cause any number of issues when changing major dependencies.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [October 10, 2022, 10:17pm UTC](https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629/4 "2022-10-10T22:17:37Z")

</div>

To follow up, the issue has been identified and can be reproduced. Thanks @jamesobutler and @Sam_Horvath for your comments 🙏

Since the SimpleITK external project depends on:

- `ITK`
- `Swig`
- `python-setuptools` (itself depending on `python-ensurepip` and `python`)
- `python`

reproducing the issue required to:

- delete the content of `D:\D\P\S-0-build\python-install`
- open the `Slicer.sln` and right-click build only onto the `python`, `python-ensurepip` and `python-setuptools` projects
- re-run the command `cmake.exe -P D:\D\P\S-0-build\SimpleITK_install_step.cmake`

Then, the warning mentioning `pip 21.3` is reported and the error is reproduced.

To address the issue, we need to add `python-pip` as a dependency to the `SimpleITK` project.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [October 10, 2022, 10:54pm UTC](https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629/5 "2022-10-10T22:54:55Z")

</div>

The regression should be fixed by [https://github.com/Slicer/Slicer/pull/6576](https://github.com/Slicer/Slicer/pull/6576)

The plan is to integrate the pull request by 10pm ET so that the upcoming round of nightly is completed with the fix.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 10, 2022, 11:52pm UTC](https://discourse.slicer.org/t/windows-nightly-build-error-pip-install-of-simpleitk-build-failing/25629/6 "2022-10-10T23:52:00Z")

</div>

> [@jcfr](#):
>
> To address the issue, we need to add `python-pip` as a dependency to the `SimpleITK` project.

Good catch! Thanks and sorry I didn’t catch that earlier.
