# Open3d pip\_install error on Mac

**URL:** https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867
**Category:** Support
**Created:** [August 5, 2020, 9:40pm UTC](https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867 "2020-08-05T21:40:20Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)
#### Post date: [August 5, 2020, 9:40pm UTC](https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867/1 "2020-08-05T21:40:20Z")

</div>

I’ve been installing open3d on my Mac Catalina using:

`slicer.util.pip_install('open3d==0.9.0')`

with no problem up until about 2 days ago. With today’s preview I’m getting the following errors:

```
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -pthread -Wall -g -fPIC -msse2 -Iextras/libargon2/src/../include -Iextras/libargon2/src/blake2 -c extras/libargon2/src/argon2.c -o build/temp.macosx-10.13-x86_64-3.6/extras/libargon2/src/argon2.o
  extras/libargon2/src/argon2.c:18:10: fatal error: 'string.h' file not found
  #include <string.h>
           ^ ~~~~~~~~~
  1 error generated.
  error: command '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for argon2-cffi
Failed to build argon2-cffi
ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 20.1.1; however, version 20.2.1 is available.
You should consider upgrading via the '/Applications/Slicer.app/Contents/bin/./python-real -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Applications/Slicer.app/Contents/bin/Python/slicer/util.py", line 2444, in pip_install
    _executePythonModule('pip', args)
  File "/Applications/Slicer.app/Contents/bin/Python/slicer/util.py", line 2420, in _executePythonModule
    logProcessOutput(proc)
  File "/Applications/Slicer.app/Contents/bin/Python/slicer/util.py", line 2392, in logProcessOutput
    raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['/Applications/Slicer.app/Contents/bin/../bin/PythonSlicer', '-m', 'pip', 'install', 'open3d==0.9.0']' returned non-zero exit status 1.

```

The first version where I can replicate this issue is from 2 days ago. The Windows preview versions install with no problem.

@pieper I believe you are using open3d on a Mac, is this something you’ve seen?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [August 5, 2020, 10:08pm UTC](https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867/2 "2020-08-05T22:08:37Z")

</div>

Hi @smrolfe - I’ve been using open3d on windows, where this problem doesn’t happen.

But I think I recognize the issue. Mac no longer have the standard headers in /usr/include, so you need to set this variable in your environment when you start Slicer:

`export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk`

The only change I can think is that this is a side effect of turning off the [ParameterSerializer](https://github.com/Slicer/Slicer/commit/7c6039021224cf1e9a1d594d9b258ab12e8e6e74), but that was a week ago now. Are you sure it’s a change in Slicer and not something else?

More info at this issue:

[https://mantisarchive.slicer.org/view.php?id=4681](https://mantisarchive.slicer.org/view.php?id=4681) (old mantis link)

Git follow up:

> <https://github.com/Slicer/Slicer/issues/4681>
>
> This issue was created automatically from an original Mantis Issue. Further discussion may take place here.

---

<div class="post-metadata">

### Author: ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)
#### Post date: [August 5, 2020, 10:25pm UTC](https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867/3 "2020-08-05T22:25:38Z")

</div>

Thanks @pieper I went back and tried some archived versions and the first one with this problem is 4.11.0-2020-07-24 r29227 / 38b40eb from 6 days ago.

---

<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: [August 5, 2020, 10:28pm UTC](https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867/4 "2020-08-05T22:28:54Z")

</div>

I installed Open3D on Windows and observed that it had to install a whole bunch of packages where some specify specific dependency versions and others don’t.

> Installing collected packages: parso, jedi, backcall, wcwidth, prompt-toolkit, decorator, pygments, colorama, pickleshare, ipython-genutils, traitlets, ipython, tornado, pywin32, jupyter-core, python-dateutil, pyzmq, jupyter-client, ipykernel, prometheus-client, pywinpty, terminado, MarkupSafe, jinja2, pycparser, cffi, argon2-cffi, Send2Trash, zipp, importlib-metadata, attrs, pyrsistent, jsonschema, nbformat, testpath, webencodings, bleach, defusedxml, mistune, entrypoints, pandocfilters, nbconvert, notebook, widgetsnbextension, ipywidgets, open3d

In this case the `notebook` package starting with version 6.1.0 added the `argon2-cffi` dependency which doesn’t have a macOS wheel available for the latest release which is why it had to build a wheel from source which it failed at in your output. Notebook version 6.1.0 was released July 31st which explains why you ran into this issue just recently.

---

<div class="post-metadata">

### Author: ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)
#### Post date: [August 5, 2020, 10:44pm UTC](https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867/5 "2020-08-05T22:44:47Z")

</div>

Thanks @jamesobutler that makes sense. I had fixed my Open3D version, but did not check for changes in the dependancies.

To test this, I installed the previous version of Notebook first:

```
slicer.util.pip_install('notebook==6.0.3')
slicer.util.pip_install('open3d==0.9.0')

```

And it now installs without error. I think this solution will work for now.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [August 5, 2020, 11:31pm UTC](https://discourse.slicer.org/t/open3d-pip-install-error-on-mac/12867/6 "2020-08-05T23:31:37Z")

</div>

Great detective work!
