WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions


Ok. It took me a few hours to administer a bandade fix, so I’m sharing in case this happens to anyone else, but it’s not a good long-term solution.

when I import pymc3 as pm, it gave a warning:

WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions

I opened Anaconda prompt and installed theano using conda (pip install didn’t solve the issue):

conda install theano

Then I restarted jupyter and imported pym3 again and got this Error:

To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.

So I did as instructed on the internet (link) and opened Anaconda Prompt, and typed:


Then I ran Jupyter Notebook through the same Anaconda prompt, by typing in:

jupyter notebook

Then, when I ran NUTS:

with model:
    mean = pm.Normal('class_A_mean', mu, sd=sigma)
    trace = pm.sample(5000, njobs=2)

I got the following error:

name ‘CVM’ is not defined

So I did what this link suggested and deleted the theano directory in:

C:\Users\username\AppData\Local\Theano directory.

Everything works and I got a beautiful result. However, every day I want to run the same script, I have to initialize anaconda prompt, insert “set MKL_THREADING_LAYER=GNU”, and delete the theano directory in my Local drive.
Is there a way around this?

I saw your post, jupenglao, referring to the “MKL_THREADING_LAYER=GNU” error but couldn’t understand how it was solved. And there must be a better way than deleting the theano folder before I run this script every time.


I was mistaken in the reply - but now this is truely fixed on theano master https://github.com/Theano/Theano/pull/6589
So there shouldnt be any problem in the next release


thanks jupenglao. Does this mean that i have to wait for theano’s next release to upgrade theano and have this solved? If theano is closing, will they still be making new releases?


Yes they are still making bug fix release.