Open3d pip_install issue

Posting on behalf of a user.

They had a difficulty installing SlicerMorph extension. When we looked into it, the computer is in Greek locale (and the user folder contain greek alphabet letters). We tried installing C:\Slicer\Slicer 4.11.20210226.

As far as I can tell, Slicer works. But pip_install gives this error message.

>>> pip_install(‘open3d==0.10’)

error: Application does NOT exists [C:/Slicer/Slicer 4.11.20210226/bin/./python-real.exe]

Usage

PythonSlicer [options]

Options

–launcher-help Display help

–launcher-version Show launcher version information

–launcher-verbose Verbose mode

–launch Specify the application to launch

–launcher-detach Launcher will NOT wait for the application to finish

–launcher-no-splash Hide launcher splash

–launcher-timeout Specify the time in second before the launcher kills the application. -1 means no timeout (default: -1)

–launcher-load-environment Specify the saved environment to load.

–launcher-dump-environment Launcher will print environment variables to be set, then exit

–launcher-show-set-environment-commands Launcher will print commands suitable for setting the parent environment (i.e. using ‘eval’ in a POSIX shell), then exit

–launcher-additional-settings Additional settings file to consider

–launcher-additional-settings-exclude-groups Comma separated list of settings groups that should NOT be overwritten by values in User and Additional settings. For example: General,Application,ExtraApplicationToLaunch

–launcher-ignore-user-additional-settings Ignore additional user settings

–launcher-generate-exec-wrapper-script Generate executable wrapper script allowing to set the environment

–launcher-generate-template Generate an example of setting file

Traceback (most recent call last):

File “”, line 1, in

File “C:\Slicer\Slicer 4.11.20210226\bin\Python\slicer\util.py”, line 2876, in pip_install

_executePythonModule(‘pip’, args)

File “C:\Slicer\Slicer 4.11.20210226\bin\Python\slicer\util.py”, line 2851, in _executePythonModule

logProcessOutput(proc)

File “C:\Slicer\Slicer 4.11.20210226\bin\Python\slicer\util.py”, line 2820, in logProcessOutput

raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)

subprocess.CalledProcessError: Command ‘[‘C:/Slicer/Slicer 4.11.20210226/bin/…/bin\PythonSlicer.EXE’, ‘-m’, ‘pip’, ‘install’, ‘open3d==0.10’]’ returned non-zero exit status 1.

This is a known issue:

The workaround is to install Slicer in a folder that only contains ASCII characters.

But it is: The second installation folder was C:\Slicer\Slicer 4.11.20210226

and that’s where the nighlighted error is coming from:

In SlicerMorph there was specific installing of certain Open3D dependency packages first to avoid the install of Open3D getting a later version of notebook. This was done because on some platforms like macOS the dependency couldn’t build the package from source.
re: Open3d pip_install error on Mac - #4 by jamesobutler

I remember Open3D having a laundry list of dependencies. Maybe something has changed in the similar manner where it is having to build a wheel that struggles with greek locale, or a dependent package was updated and resulted in changes.

Seems bizarre and non-repo. Now the user reports after deleting the contents of the folder and rerunning all the installation steps, everything is working fine. Thanks for the input.

There have been other situations of users who have built wheels successfully using a system python after it was not successful using Slicer’s python. Then when they try to install again from within Slicer it will pull that cached wheel and then it installs successfully in Slicer.

when i used /PythonSlice to install open3d in linux. i can not import open3d from the CIL in slicer .

what happens when you type:

pip_install('open3d')
import open3d 

in the python console?

For a mid/long-term solution: Open3D’s scope is so fuzzy (essentially “everything that our lab does”) and developers are so reckless in bringing in dependencies that it will be practically impossible to keep it working on all platforms all the time. I would recommend to request the developers to split up the package and/or reduce their dependencies and if they are not willing to do this then look for alternatives.

Open3D==0.13.0 has a reasonable requirements.txt, but it is their requirements_jupyter.txt that brings in all those extra requirements that lead to issues.

requirements.txt

setuptools>=40.8.0
wheel>=0.36.0
numpy>=1.18.0

requirements_jupyter.txt

ipywidgets>=7.6.0
pygments>=2.7.4
jupyter_packaging~=0.10
jupyterlab>=3.0.0,==3.*

Look at these vendored third-party dependencies: Open3D/3rdparty at master · intel-isl/Open3D · GitHub. It is a lot and all messy (lots of hardware-dependent libraries; some libraries are brought in using submodules, some as superbuild, some are just copy-pasted; some are really big). OpenCV is quite bad in this regard, too (probably Open3D developers got their “best practices” from there) but at least you can see that OpenCV developers only vendorize a small set of carefully chosen third-party libraries and other third-party libraries are in a separate repository, organized into optional modules.

Open3D is increasingly looking like an application and not a library and such it is not well suited to be used as part of another application. It has some useful content, but to make it usable as a library, it would need to split up, cleaned up, and put together in a more disciplined way.