Can't import without RuntimeError: To use MKL 2018 with Theano you MUST set "MKL_THREADING_LAYER=GNU" in your environement

I’m trying to run pymc3 via docker. In the dockerfile, I simply:
1/ conda install mkl-service
2/ pip install pymc3

However, when I try to import pymc3 I got the following error:
To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.

Does anyone know how I can fix this? I don’t actually know how I’d set MKL_THREADING_LAYER=GNU via docker (and this is running on an aws cluster in which I don’t have terminal access).

Thanks

Did you try copying the setup from https://github.com/pymc-devs/pymc3/tree/master/scripts ?

Got it to work by setting an ENV variable in the dockerfile.

1 Like

Also, I think this is recently fixed on the theano side:
https://github.com/Theano/Theano/issues/6580