# Cannot import JAX using M1 Mac

**URL:** <https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579>\
**Category:** v5\
**Created:** [June 6, 2022, 9:51pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579 "2022-06-06T21:51:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![j\_catulo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/j_catulo/32/4892_2.png) [@j\_catulo](https://discourse.pymc.io/u/j_catulo)\
**Post date:** [June 6, 2022, 9:51pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/1 "2022-06-06T21:51:51Z")

</div>

Hi!

I have just installed version 4 of PyMC on an Apple m1 device and I followed [these](https://github.com/pymc-devs/pymc/wiki/Installation-Guide-(MacOS)) instructions.

However, when I try to import jax, I get the following error:

```auto
RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.

```

How can I fix this?

**P.S.** I have recently started working with PyMC and I am learning a lot. I cannot wait to use this new version. Thank you for your hard work!

---

<div class="post-metadata">

**Author:** ![johol355](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/johol355/32/5741_2.png) [@johol355](https://discourse.pymc.io/u/johol355)\
**Post date:** [October 16, 2022, 1:04pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/2 "2022-10-16T13:04:50Z")

</div>

I running into this issue as well. Did you figure it out eventually?

---

<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:** [October 16, 2022, 2:08pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/3 "2022-10-16T14:08:12Z")

</div>

Note that the “official” installation instructions can be found [here](https://www.pymc.io/projects/docs/en/latest/installation.html). What version of jax do you have installed and how was it installed?

---

<div class="post-metadata">

**Author:** ![johol355](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/johol355/32/5741_2.png) [@johol355](https://discourse.pymc.io/u/johol355)\
**Post date:** [October 16, 2022, 2:31pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/4 "2022-10-16T14:31:06Z")

</div>

Installed jax and jaxlib == 0.3.0 using pip install.

---

<div class="post-metadata">

**Author:** ![aakhmetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/aakhmetz/32/1500_2.png) [@aakhmetz](https://discourse.pymc.io/u/aakhmetz)\
**Post date:** [October 16, 2022, 5:12pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/5 "2022-10-16T17:12:28Z")

</div>

I have M1, and I don’t have this message. I used:

> python3 -m pip install jax jaxlib numpyro

---

<div class="post-metadata">

**Author:** ![johol355](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/johol355/32/5741_2.png) [@johol355](https://discourse.pymc.io/u/johol355)\
**Post date:** [October 16, 2022, 5:24pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/6 "2022-10-16T17:24:24Z")

</div>

Good to hear! What versions of jax, jaxlib, numpyro and python are you on?

---

<div class="post-metadata">

**Author:** ![aakhmetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/aakhmetz/32/1500_2.png) [@aakhmetz](https://discourse.pymc.io/u/aakhmetz)\
**Post date:** [October 16, 2022, 5:33pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/7 "2022-10-16T17:33:24Z")

</div>

```auto
>>> print(watermark(packages="jax,jaxlib,numpyro"))
jax : 0.3.23
jaxlib : 0.3.22
numpyro: 0.10.1

# no messages
>>> import jaxlib
>>> import jax

```

Python is 3.10.8

---

<div class="post-metadata">

**Author:** ![johol355](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/johol355/32/5741_2.png) [@johol355](https://discourse.pymc.io/u/johol355)\
**Post date:** [October 17, 2022, 7:16pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/8 "2022-10-17T19:16:27Z")

</div>

Finally got it to work! I re-installed mini forge, this time not using homebrew. (Ad modem [Mac M1 Monterey Installing Miniforge and Anaconda/Miniconda Side-by-Side - YouTube](https://www.youtube.com/watch?v=w2qlou7n7MA)).

Hang in there, j\_catulo, the sweet sweet performance increase is worth it.

---

<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:** [October 17, 2022, 7:19pm UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/9 "2022-10-17T19:19:44Z")

</div>

> [@johol355](#):
>
> this time not using homebrew

Ah yes. I definitely suggest using the recommended installation routine at all time, regardless of platform. Glad it worked out for you!

---

<div class="post-metadata">

**Author:** ![aakhmetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/aakhmetz/32/1500_2.png) [@aakhmetz](https://discourse.pymc.io/u/aakhmetz)\
**Post date:** [October 18, 2022, 6:11am UTC](https://discourse.pymc.io/t/cannot-import-jax-using-m1-mac/9579/10 "2022-10-18T06:11:46Z")

</div>

I used homebrew in my case - so, maybe there was something else
