# Installing open3d is giving an error

**URL:** <https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978>\
**Category:** Support\
**Tags:** slicermorph\
**Created:** [June 6, 2021, 8:22pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978 "2021-06-06T20:22:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcolbert](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bcolbert/32/11162_2.png) [@bcolbert](https://discourse.slicer.org/u/bcolbert)\
**Post date:** [June 6, 2021, 8:22pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/1 "2021-06-06T20:22:33Z")

</div>

I am attempting to use ALPACA. When using this tool for the first time I am prompted that open3D will be installed. I allow it do do this but then I get a series of errors which are beyond my ability to troubleshoot. Any suggestions would be very welcome.

```auto
o3d installed
Collecting git+https://github.com/agporto/pycpd.git@development
  Cloning https://github.com/agporto/pycpd.git (to revision development) to c:\users\ben\appdata\local\temp\pip-req-build-xye84wj1
  ERROR: Error [WinError 2] The system cannot find the file specified while executing command git clone -q https://github.com/agporto/pycpd.git 'C:\Users\Ben\AppData\Local\Temp\pip-req-build-xye84wj1'
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
WARNING: You are using pip version 20.3.3; however, version 21.1.2 is available.
You should consider upgrading via the 'C:\Users\Ben\AppData\Local\NA-MIC\Slicer 4.11.20210226\bin\python-real.exe -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "C:/Users/Ben/AppData/Local/NA-MIC/Slicer 4.11.20210226/NA-MIC/Extensions-29738/SlicerMorph/lib/Slicer-4.11/qt-scripted-modules/ALPACA.py", line 60, in __init__
    from pycpd import DeformableRegistration
ModuleNotFoundError: No module named 'pycpd'

```

---

<div class="post-metadata">

**Author:** ![bcolbert](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bcolbert/32/11162_2.png) [@bcolbert](https://discourse.slicer.org/u/bcolbert)\
**Post date:** [June 7, 2021, 12:39pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/2 "2021-06-07T12:39:29Z")

</div>

I am attempting to use ALPACA. When using this tool for the first time I am prompted that open3D will be installed. I allow it do do this but then I get a series of errors which are beyond my ability to troubleshoot. Any suggestions would be very welcome.

```auto
o3d installed
Collecting git+https://github.com/agporto/pycpd.git@development
  Cloning https://github.com/agporto/pycpd.git (to revision development) to c:\users\ben\appdata\local\temp\pip-req-build-xye84wj1
  ERROR: Error [WinError 2] The system cannot find the file specified while executing command git clone -q https://github.com/agporto/pycpd.git 'C:\Users\Ben\AppData\Local\Temp\pip-req-build-xye84wj1'
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
WARNING: You are using pip version 20.3.3; however, version 21.1.2 is available.
You should consider upgrading via the 'C:\Users\Ben\AppData\Local\NA-MIC\Slicer 4.11.20210226\bin\python-real.exe -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "C:/Users/Ben/AppData/Local/NA-MIC/Slicer 4.11.20210226/NA-MIC/Extensions-29738/SlicerMorph/lib/Slicer-4.11/qt-scripted-modules/ALPACA.py", line 60, in __init__
    from pycpd import DeformableRegistration
ModuleNotFoundError: No module named 'pycpd'

```

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 7, 2021, 12:39pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/3 "2021-06-07T12:39:38Z")

</div>



---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 7, 2021, 3:24pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/4 "2021-06-07T15:24:48Z")

</div>

@bcolbert  
For a brief period we used git to install open3d, which unfortunately wasn’t as commonly available. Looks like you installed the SlicerMorph during that time. Please update your SlicerMorph installation following [this instructions](https://github.com/SlicerMorph/SlicerMorph#updating-slicermorph).

Open the python window, and type or copy/paste these commands

```auto
pip_install('notebook==6.0.3')
pip_install('open3d==0.10.0')
pip_install('pycpd')

```

and then try using alpaca

---

<div class="post-metadata">

**Author:** ![bcolbert](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bcolbert/32/11162_2.png) [@bcolbert](https://discourse.slicer.org/u/bcolbert)\
**Post date:** [June 8, 2021, 9:44am UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/5 "2021-06-08T09:44:03Z")

</div>

Worked great. Thanks!

---

<div class="post-metadata">

**Author:** ![bcolbert](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bcolbert/32/11162_2.png) [@bcolbert](https://discourse.slicer.org/u/bcolbert)\
**Post date:** [April 22, 2022, 2:06pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/6 "2022-04-22T14:06:00Z")

</div>

Sorry to revice an old post but I am having a similar error. When I run the command lines you suggested I now get an error on: pip\_install(‘open3d==0.10.0’):

```auto
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Users\Benjamin Colbert\AppData\Local\NA-MIC\Slicer 4.13.0-2022-02-20\bin\Python\slicer\util.py", line 3155, in pip_install
    _executePythonModule('pip', args)
  File "C:\Users\Benjamin Colbert\AppData\Local\NA-MIC\Slicer 4.13.0-2022-02-20\bin\Python\slicer\util.py", line 3130, in _executePythonModule
    logProcessOutput(proc)
  File "C:\Users\Benjamin Colbert\AppData\Local\NA-MIC\Slicer 4.13.0-2022-02-20\bin\Python\slicer\util.py", line 3099, in logProcessOutput
    raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['C:/Users/Benjamin Colbert/AppData/Local/NA-MIC/Slicer 4.13.0-2022-02-20/bin/../bin\\PythonSlicer.EXE', '-m', 'pip', 'install', 'open3d==0.10.0']' returned non-zero exit status 1.

```

Is there a solution to this?

---

<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:** [April 22, 2022, 2:12pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/7 "2022-04-22T14:12:15Z")

</div>

It appears you have switched from using Slicer 4.11.20210226 to now using Slicer 4.13.0-2022-02-20. This corresponds with a switch from Python 3.6 to Python 3.9. `open3d` does not have Python 3.9 whl files to install with version 0.10.0 as that version was released prior to Python 3.9 being released.

You should not manually install `open3d` if you are using a recent Slicer preview build. You should let the SlicerMorph extension install it for you when requested. I would suggest installing the latest Slicer Preview build as the one you currently have is about 2 months old now and also will get latest SlicerMorph.

---

<div class="post-metadata">

**Author:** ![bcolbert](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bcolbert/32/11162_2.png) [@bcolbert](https://discourse.slicer.org/u/bcolbert)\
**Post date:** [April 22, 2022, 4:15pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/8 "2022-04-22T16:15:47Z")

</div>

I downloaded the new version, installed slicermorph and auto3dgm and then ran Alpaca and accepted the prompt for installing the open3d library and it hangs up and I get the following error in Python:

```auto
ERROR: Invalid requirement: 'C:/Users/Benjamin'
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the 'C:\Users\Benjamin Colbert\AppData\Local\NA-MIC\Slicer 4.13.0-2022-04-19\bin\python-real.exe -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "C:/Users/Benjamin Colbert/AppData/Local/NA-MIC/Slicer 4.13.0-2022-04-19/NA-MIC/Extensions-30789/SlicerMorph/lib/Slicer-4.13/qt-scripted-modules/ALPACA.py", line 147, in __init__
    slicer.util.pip_install(wheelPath)
  File "C:\Users\Benjamin Colbert\AppData\Local\NA-MIC\Slicer 4.13.0-2022-04-19\bin\Python\slicer\util.py", line 3363, in pip_install
    _executePythonModule('pip', args)
  File "C:\Users\Benjamin Colbert\AppData\Local\NA-MIC\Slicer 4.13.0-2022-04-19\bin\Python\slicer\util.py", line 3337, in _executePythonModule
    logProcessOutput(proc)
  File "C:\Users\Benjamin Colbert\AppData\Local\NA-MIC\Slicer 4.13.0-2022-04-19\bin\Python\slicer\util.py", line 3306, in logProcessOutput
    raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['C:/Users/Benjamin Colbert/AppData/Local/NA-MIC/Slicer 4.13.0-2022-04-19/bin/../bin\\PythonSlicer.EXE', '-m', 'pip', 'install', 'C:/Users/Benjamin', 'Colbert/AppData/Local/NA-MIC/Slicer/cache/SlicerIO/open3d-0.14.1+816263b-cp39-cp39-win_amd64.whl']' returned non-zero exit status 1.

```

---

<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:** [April 22, 2022, 4:59pm UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/9 "2022-04-22T16:59:40Z")

</div>

> [@bcolbert](#):
>
> `PythonSlicer.EXE', '-m', 'pip', 'install', 'C:/Users/Benjamin', 'Colbert/AppData/Local/NA-MIC/Slicer/cache/SlicerIO/open3d-0.14.1+816263b-cp39-cp39-win_amd64.whl']' returned non-zero exit status 1.`

The problem originates due to a space located in the path (“Benjamin Colbert”) to the custom open3d-0.14.1 whl file that was installed. This space inappropriately leads it to be split into different arguments.

A quick workaround would be to relocate “C:/Users/Benjamin Colbert/AppData/Local/NA-MIC/Slicer/cache/SlicerIO/open3d-0.14.1+816263b-cp39-cp39-win\_amd64.whl” to “C:/open3d-0.14.1+816263b-cp39-cp39-win\_amd64.whl” and then do `slicer.util.pip_install(r"C:\open3d-0.14.1+816263b-cp39-cp39-win_amd64.whl")`.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 24, 2022, 5:34am UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/10 "2022-04-24T05:34:02Z")

</div>

I’ve improved the `pip_install` function so that it supports installing a downloaded wheel from a folder that has spaces in the name. The path either has to be quoted or provided as a list:

```auto
wheelPath = 'C:/Users/Benjamin Colbert/AppData/Local/NA-MIC/Slicer/cache/SlicerIO/open3d-0.14.1+816263b-cp39-cp39-win_amd64.whl'

# Option A: Quote the string (quoted strings are not split)
slicer.util.pip_install(f'"{wheelPath}"')

# Option B: Provide arguments as list (input argument is not split)
slicer.util.pip_install([wheelPath])

```

SlicerMorph needs to be updated accordingly - I’ve submitted a fix:

> <https://github.com/SlicerMorph/SlicerMorph/pull/206>
>
> Fixes the issue of pip\_install splitting up input wheel path at spaces.
> See htt…ps://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/10?u=lassoan

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [April 25, 2022, 1:04am UTC](https://discourse.slicer.org/t/installing-open3d-is-giving-an-error/17978/11 "2022-04-25T01:04:29Z")

</div>

Thanks Andras. This is now merged.
