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

**URL:** <https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008>\
**Category:** Questions\
**Tags:** aesara\
**Created:** [December 14, 2022, 9:08am UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008 "2022-12-14T09:08:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![guin0x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/guin0x/32/5929_2.png) [@guin0x](https://discourse.pymc.io/u/guin0x)\
**Post date:** [December 14, 2022, 9:08am UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/1 "2022-12-14T09:08:04Z")

</div>

I’m having issues when importing `pymc`… I get the error `WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.`.

Following [this](https://discourse.pymc.io/t/pymc-v4-install-issue-warning-using-numpy-c-api-based-implementation-for-blas-functions/9621) discussion I removed my conda environment and will start fresh from a new one… and will install using `mamba` instead of `conda` to install `pymc`.

I was wondering if its OK to have Python on version 3.11 or should I just keep the new env with Python 3.9?

—EDIT----

I have followed those steps and I still get the warning mentioned above when importing `pymc`. Any ideas how to fix this?

Thank you!

---

<div class="post-metadata">

**Author:** ![Dekermanjian](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Dekermanjian](https://discourse.pymc.io/u/Dekermanjian)\
**Post date:** [December 14, 2022, 10:28pm UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/2 "2022-12-14T22:28:34Z")

</div>

Hi, are you by chance using a Jupyter Notebook within VScode? I get the same issue in VScode but if I actually launch Jupyter in the web browser that warning disappears for me.

---

<div class="post-metadata">

**Author:** ![guin0x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/guin0x/32/5929_2.png) [@guin0x](https://discourse.pymc.io/u/guin0x)\
**Post date:** [December 15, 2022, 11:18am UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/3 "2022-12-15T11:18:28Z")

</div>

No… that is using Jupyter in the browser…

---

<div class="post-metadata">

**Author:** ![AlexAndorra](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/alexandorra/32/9142_2.png) [@AlexAndorra](https://discourse.pymc.io/u/AlexAndorra)\
**Post date:** [December 15, 2022, 3:51pm UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/4 "2022-12-15T15:51:53Z")

</div>

Hey! Actually that’s not an error, just a warning – PyMC is telling you that it’s gonna use the Numpy C backend, which may be slower for some advanced operations.  
So, if your use-case is not too complex, you don’t need to worry about.

Overall, that thing depends on a lot of variables-- which platform you’re using, which version of PyMC, etc.

Hope that helps, and PyMCheers 🖖

---

<div class="post-metadata">

**Author:** ![guin0x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/guin0x/32/5929_2.png) [@guin0x](https://discourse.pymc.io/u/guin0x)\
**Post date:** [December 15, 2022, 4:07pm UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/5 "2022-12-15T16:07:14Z")

</div>

Hi!  
Thanks for your reply.

I understand its just a Warning but I would definitely prefer the speed of C instead of the speed of Python :p.

That warning happens when I run it in my work laptop which is Windows. On my personal laptop it works fine.

I have had issues with PyMC in that laptop before and I had to install conda to install the `w64-toolchains`. This solved some issues, but I still get that Warning…

Any idea how I could go about to fix or troubleshoot this? As mentioned before, the tips of installing pymc with mamba didn’t change anything.

Thanks!

---

<div class="post-metadata">

**Author:** ![ruyuanzhang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ruyuanzhang/32/5951_2.png) [@ruyuanzhang](https://discourse.pymc.io/u/ruyuanzhang)\
**Post date:** [December 24, 2022, 6:35am UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/6 "2022-12-24T06:35:19Z")

</div>

I saw the same error when using vscode.

```python
import pymc as pm
WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

print(pm __version__ )
5.0.0

with pm.Model() as basic_model:

    # Priors for unknown model parameters
    alpha = pm.Normal("alpha", mu=0, sigma=10)
    beta = pm.Normal("beta", mu=0, sigma=10, shape=2)

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: InplaceDimShuffle{}(TensorConstant{(1,) of 2})
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1933, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1092, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/tensor/rewriting/basic.py", line 1141, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/op.py", line 131, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/op.py", line 96, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/basic.py", line 1202, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self. __compile__ (
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/basic.py", line 1122, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/basic.py", line 1647, in cthunk_factory
    module = cache.module_from_key(key=key, lnk=self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/cmodule.py", line 1229, in module_from_key
    module = lnk.compile_cmodule(location)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/basic.py", line 1546, in compile_cmodule
    module = c_compiler.compile_str(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/cmodule.py", line 2641, in compile_str
    raise CompileError(
pytensor.link.c.exceptions.CompileError: Compilation failed (return status=1):
/Users/ruyuan/opt/miniconda3/envs/pymc_env/bin/clang++ -dynamiclib -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -Wno-c++11-narrowing -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -undefined dynamic_lookup -I/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/numpy/core/include -I/Users/ruyuan/opt/miniconda3/envs/pymc_env/include/python3.11 -I/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib/python3.11/site-packages/pytensor/link/c/c_code -L/Users/ruyuan/opt/miniconda3/envs/pymc_env/lib -fvisibility=hidden -o /Users/ruyuan/.pytensor/compiledir_macOS-11.7-x86_64-i386-64bit-i386-3.11.0-64/tmpoh2u6l_j/mdb3a1a186c6e0c789bc6494774a591ac6d8ab11d3ed19bf02a4ff96ab64fa9ba.so /Users/ruyuan/.pytensor/compiledir_macOS-11.7-x86_64-i386-64bit-i386-3.11.0-64/tmpoh2u6l_j/mod.cpp
In file included from /Users/ruyuan/.pytensor/compiledir_macOS-11.7-x86_64-i386-64bit-i386-3.11.0-64/tmpoh2u6l_j/mod.cpp:1:
In file included from /Users/ruyuan/opt/miniconda3/envs/pymc_env/include/python3.11/Python.h:23:
/Users/ruyuan/opt/miniconda3/envs/pymc_env/bin/../include/c++/v1/stdlib.h:93:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
              ^ ~~~~~~~~~
1 error generated.

```

Basically, I cannot use pymc in vscode. But opening a jupyter notebook in a browser is OK.

---

<div class="post-metadata">

**Author:** ![cluhmann](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cluhmann/32/3083_2.png) [@cluhmann](https://discourse.pymc.io/u/cluhmann)\
**Post date:** [December 24, 2022, 4:47pm UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/7 "2022-12-24T16:47:31Z")

</div>

PyMC is not yet being testing on python 3.11. Is that what you finally went with?

---

<div class="post-metadata">

**Author:** ![guin0x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/guin0x/32/5929_2.png) [@guin0x](https://discourse.pymc.io/u/guin0x)\
**Post date:** [December 25, 2022, 10:22am UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/8 "2022-12-25T10:22:28Z")

</div>

@ruyuanzhang I was getting this warning on my jupyter notebook and that had to do with the version of Python I was using in the notebook. It was fixed once I created a new kernel on my virtual env and set the Python version to 3.8 (or maybe 3.9).

Maybe your jupyter notebook runs on 3.8~3.9 and your VSCode on 3.11 and that’s why you get errors on VSCode and not jupyter notebook?

---

<div class="post-metadata">

**Author:** ![ruyuanzhang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ruyuanzhang/32/5951_2.png) [@ruyuanzhang](https://discourse.pymc.io/u/ruyuanzhang)\
**Post date:** [December 26, 2022, 2:43am UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/9 "2022-12-26T02:43:53Z")

</div>

@guin0x @cluhmann Thanks so much. I checked both jupyter notebook in browsers and vscode. It shows both 3.11. Maybe 3.11 is too new. But the default installation of pymc requires 3.11. Better to force it to 3.10??

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [December 26, 2022, 8:11am UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/10 "2022-12-26T08:11:23Z")

</div>

I can run everything fine on M1 and 3.11.

---

<div class="post-metadata">

**Author:** ![AlexAndorra](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/alexandorra/32/9142_2.png) [@AlexAndorra](https://discourse.pymc.io/u/AlexAndorra)\
**Post date:** [December 27, 2022, 8:58pm UTC](https://discourse.pymc.io/t/warning-aesara-tensor-blas-using-numpy-c-api-based-implementation-for-blas-functions/11008/11 "2022-12-27T20:58:41Z")

</div>

Same
