ImportError on mac with pytorch 1.1

Hi, I just updated the pytorch version from 1.0 to 1.1. When importing pytorch, I was given the following error:

Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 26 2018, 19:50:54)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import torch
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-eb42ca6e4af3> in <module>()
----> 1 import torch

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/__init__.py in <module>()
     77 del _dl_flags
     78
---> 79 from torch._C import *
     80
     81 __all__ += [name for name in dir(_C)

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/_C.cpython-36m-darwin.so, 9): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/lib/libshm.dylib
  Reason: image not found

Any suggestion to fix it?

Thanks,
Liang

You may need to install libomp. There was a similar issue discussed on GitHub.

Cheers,
Yicheng

brew install libomp fixed the issues, thanks!