segfault when using xarray, only when 'import torch'
I get a segfault when I open a file using xarray, but only if I import torch (imagine how long it took me to figure this out):

import xarray as xr
import torch

xr.open_dataset('my/file.nc')

----

[1651963ee602:10863] *** Process received signal ***
[1651963ee602:10863] Signal: Segmentation fault (11)
[1651963ee602:10863] Signal code: Address not mapped (1)
[1651963ee602:10863] Failing at address: 0x440000e9
[1651963ee602:10863] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f26f1e11890]
[1651963ee602:10863] [ 1] /usr/local/mpi/lib/libmpi.so.40(PMPI_Comm_set_errhandler+0x41)[0x7f26dc349691]
[1651963ee602:10863] [ 2] /opt/conda/lib/python3.6/site-packages/mpi4py/MPI.cpython-36m-x86_64-linux-gnu.so(+0x82370)[0x7f26cadc2370]
[1651963ee602:10863] [ 3] /opt/conda/lib/python3.6/site-packages/mpi4py/MPI.cpython-36m-x86_64-linux-gnu.so(+0x2dd79)[0x7f26cad6dd79]
[1651963ee602:10863] [ 4] /opt/conda/bin/python /opt/conda/bin/ipython(PyModule_ExecDef+0x7a)[0x55cad2262cca]
[1651963ee602:10863] [ 5] /opt/conda/bin/python /opt/conda/bin/ipython(+0x1ecd38)[0x55cad2262d38]
[1651963ee602:10863] [ 6] /opt/conda/bin/python /opt/conda/bin/ipython(PyCFunction_Call+0xf4)[0x55cad218cb54]
[1651963ee602:10863] [ 7] /opt/conda/bin/python /opt/conda/bin/ipython(_PyEval_EvalFrameDefault+0x539a)[0x55cad224183a]
[1651963ee602:10863] [ 8] /opt/conda/bin/python /opt/conda/bin/ipython(+0x170cf6)[0x55cad21e6cf6]
[1651963ee602:10863] [ 9] /opt/conda/bin/python /opt/conda/bin/ipython(+0x171c91)[0x55cad21e7c91]
[1651963ee602:10863] [10] /opt/conda/bin/python /opt/conda/bin/ipython(+0x1a1635)[0x55cad2217635]
[1651963ee602:10863] [11] /opt/conda/bin/python /opt/conda/bin/ipython(_PyEval_EvalFrameDefault+0x30a)[0x55cad223c7aa]
[1651963ee602:10863] [12] /opt/conda/bin/python /opt/conda/bin/ipython(+0x171a5b)[0x55cad21e7a5b]
[1651963ee602:10863] [13] /opt/conda/bin/python /opt/conda/bin/ipython(+0x1a1635)[0x55cad2217635]
[1651963ee602:10863] [14] /opt/conda/bin/python /opt/conda/bin/ipython(_PyEval_EvalFrameDefault+0x30a)[0x55cad223c7aa]
[1651963ee602:10863] [15] /opt/conda/bin/python /opt/conda/bin/ipython(+0x171a5b)[0x55cad21e7a5b]
[1651963ee602:10863] [16] /opt/conda/bin/python /opt/conda/bin/ipython(+0x1a1635)[0x55cad2217635]
[1651963ee602:10863] [17] /opt/conda/bin/python /opt/conda/bin/ipython(_PyEval_EvalFrameDefault+0x30a)[0x55cad223c7aa]
[1651963ee602:10863] [18] /opt/conda/bin/python /opt/conda/bin/ipython(+0x171a5b)[0x55cad21e7a5b]
[1651963ee602:10863] [19] /opt/conda/bin/python /opt/conda/bin/ipython(+0x1a1635)[0x55cad2217635]
[1651963ee602:10863] [20] /opt/conda/bin/python /opt/conda/bin/ipython(_PyEval_EvalFrameDefault+0x30a)[0x55cad223c7aa]
[1651963ee602:10863] [21] /opt/conda/bin/python /opt/conda/bin/ipython(_PyFunction_FastCallDict+0x11b)[0x55cad21e80cb]
[1651963ee602:10863] [22] /opt/conda/bin/python /opt/conda/bin/ipython(_PyObject_FastCallDict+0x26f)[0x55cad2189f0f]
[1651963ee602:10863] [23] /opt/conda/bin/python /opt/conda/bin/ipython(_PyObject_CallMethodIdObjArgs+0x100)[0x55cad21b3be0]
[1651963ee602:10863] [24] /opt/conda/bin/python /opt/conda/bin/ipython(PyImport_ImportModuleLevelObject+0x280)[0x55cad21804b0]
[1651963ee602:10863] [25] /opt/conda/bin/python /opt/conda/bin/ipython(+0x1abbda)[0x55cad2221bda]
[1651963ee602:10863] [26] /opt/conda/bin/python /opt/conda/bin/ipython(PyCFunction_Call+0xc6)[0x55cad218cb26]
[1651963ee602:10863] [27] /opt/conda/bin/python /opt/conda/bin/ipython(PyObject_Call+0x3e)[0x55cad218994e]
[1651963ee602:10863] [28] /opt/conda/bin/python /opt/conda/bin/ipython(PyObject_CallFunction+0xf4)[0x55cad21e6854]
[1651963ee602:10863] [29] /opt/conda/bin/python /opt/conda/bin/ipython(PyImport_Import+0x9e)[0x55cad2180a9e]
[1651963ee602:10863] *** End of error message ***
[1]    10863 segmentation fault (core dumped)  ipython


This works:

import xarray as xr

xr.open_dataset('my/file.nc')


This works as well:

import xarray as xr
import torch

print(torch.ones(1))



OS       ubuntu 18.04.3
python   3.6.7
xarray   0.15.0
torch    1.3.0a0+24ae9b5


I appreciate any help.

Installing netcdf4 via pip solved the problem.
