Installing open3d is giving an error

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.

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'

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.

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'

@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.

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

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

and then try using alpaca

Worked great. Thanks!

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’):

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?

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.

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:

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.

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").

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:

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:

2 Likes

Thanks Andras. This is now merged.

1 Like