# Pymc3 on Apple M1 Studio - numpy error float128

**URL:** <https://discourse.pymc.io/t/pymc3-on-apple-m1-studio-numpy-error-float128/9184>\
**Category:** v3\
**Tags:** bug\
**Created:** [April 10, 2022, 7:37am UTC](https://discourse.pymc.io/t/pymc3-on-apple-m1-studio-numpy-error-float128/9184 "2022-04-10T07:37:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Palmer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/bryan_palmer/32/4682_2.png) [@Bryan\_Palmer](https://discourse.pymc.io/u/Bryan_Palmer)\
**Post date:** [April 10, 2022, 7:37am UTC](https://discourse.pymc.io/t/pymc3-on-apple-m1-studio-numpy-error-float128/9184/1 "2022-04-10T07:37:16Z")

</div>

I have seen it reported that this issue has been fixed, but on a new download using miniforge I get this error, with code that worked unchanged from a month ago.

> Last login: Sun Apr 10 17:28:02 on ttys001
> 
> (base) me@MacStudio ~ % conda list pymc3
> 
> # packages in environment at /opt/homebrew/Caskroom/miniforge/base:
> 
> # 
> 
> # Name Version Build Channel
> 
> pymc3 3.9.3 pyhd8ed1ab\_3 conda-forge
> 
> (base) bryanpalmer@BryansMacStudio ~ % ipython
> 
> Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:24:38)
> 
> Type ‘copyright’, ‘credits’ or ‘license’ for more information
> 
> IPython 8.2.0 – An enhanced Interactive Python. Type ‘?’ for help.
> 
> In [**1**]: **import**  **numpy**  **as**  **np**
> 
> In [**2**]: np. **version**
> 
> Out[**2**]: ‘1.22.3’
> 
> In [**3**]: **import**  **pymc3**  **as**  **pm**
> 
> WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named ‘mkl’
> 
> * * *
> 
> TypeError Traceback (most recent call last)
> 
> Input In [3], in \<cell line: 1\>()
> 
> ----\> 1 **import**  **pymc3**  **as**  **pm**
> 
> File /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/pymc3/ **init**.py:41, in
> 
> **38** \_\_set\_compiler\_flags()
> 
> **40**  **from**  **.blocking**  **import** \*
> 
> —\> 41 **from**  **.distributions**  **import** \*
> 
> **42**  **from**  **.distributions**  **import** transforms
> 
> **43**  **from**  **.glm**  **import** \*
> 
> File /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/pymc3/distributions/ **init**.py:15, in
> 
> **1** _# Copyright 2020 The PyMC Developers_
> 
> **2** _#_
> 
> **3** _# Licensed under the Apache License, Version 2.0 (the “License”);_
> 
> (…)
> 
> **12** _# See the License for the specific language governing permissions and_
> 
> **13** _# limitations under the License._
> 
> —\> 15 **from**  **.**  **import** timeseries
> 
> **16**  **from**  **.**  **import** transforms
> 
> **17**  **from**  **.**  **import** shape\_utils
> 
> File /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/pymc3/distributions/timeseries.py:23, in
> 
> **20**  **import**  **numpy**  **as**  **np**
> 
> **22**  **from**  **pymc3.util**  **import** get\_variable\_name
> 
> —\> 23 **from**  **.continuous**  **import** get\_tau\_sigma, Normal, Flat
> 
> **24**  **from**  **.shape\_utils**  **import** to\_tuple
> 
> **25**  **from**  **.**  **import** multivariate
> 
> File /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/pymc3/distributions/continuous.py:32, in
> 
> **30**  **from**  **.special**  **import** log\_i0
> 
> **31**  **from**  **…math**  **import** invlogit, logit, logdiffexp
> 
> —\> 32 **from**  **.dist\_math**  **import** (
> 
> **33** alltrue\_elemwise, betaln, bound, gammaln, i0e, incomplete\_beta, logpow,
> 
> **34** normal\_lccdf, normal\_lcdf, SplineWrapper, std\_cdf, zvalue,
> 
> **35** clipped\_beta\_rvs,
> 
> **36** )
> 
> **37**  **from**  **.distribution**  **import** (Continuous, draw\_values, generate\_samples)
> 
> **39**  **all** = [‘Uniform’, ‘Flat’, ‘HalfFlat’, ‘Normal’, ‘TruncatedNormal’, ‘Beta’,
> 
> **40** ‘Kumaraswamy’, ‘Exponential’, ‘Laplace’, ‘StudentT’, ‘Cauchy’,
> 
> **41** ‘HalfCauchy’, ‘Gamma’, ‘Weibull’, ‘HalfStudentT’, ‘Lognormal’,
> 
> **42** ‘ChiSquared’, ‘HalfNormal’, ‘Wald’, ‘Pareto’, ‘InverseGamma’,
> 
> **43** ‘ExGaussian’, ‘VonMises’, ‘SkewNormal’, ‘Triangular’, ‘Gumbel’,
> 
> **44** ‘Logistic’, ‘LogitNormal’, ‘Interpolated’, ‘Rice’, ‘Moyal’]
> 
> File /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/pymc3/distributions/dist\_math.py:44, in
> 
> **38** \_beta\_clip\_values = {
> 
> **39** dtype: (np.nextafter(0, 1, dtype=dtype), np.nextafter(1, 0, dtype=dtype))
> 
> **40**  **for** dtype **in** [“float16”, “float32”, “float64”]
> 
> **41** }
> 
> **42**  **if** platform.system() **in** [“Linux”, “Darwin”]:
> 
> **43** \_beta\_clip\_values[“float128”] = (
> 
> —\> 44 np.nextafter(0, 1, dtype=“float128”),
> 
> **45** np.nextafter(1, 0, dtype=“float128”)
> 
> **46** )
> 
> **50**  **def** bound(logp, \*conditions, \*\*kwargs):
> 
> **51** _“”"_
> 
> **52** _Bounds a log probability density with several conditions._
> 
> **53**
> 
> (…)
> 
> **67** _logp with elements set to -inf where any condition is False_
> 
> **68** _“”"_
> 
> TypeError: data type ‘float128’ not understood
> 
> In [**4**]:

---

<div class="post-metadata">

**Author:** ![Bryan\_Palmer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/bryan_palmer/32/4682_2.png) [@Bryan\_Palmer](https://discourse.pymc.io/u/Bryan_Palmer)\
**Post date:** [April 18, 2022, 11:46pm UTC](https://discourse.pymc.io/t/pymc3-on-apple-m1-studio-numpy-error-float128/9184/2 "2022-04-18T23:46:49Z")

</div>

The only workaround I have found is to install pymc3 using pip (first thing after miniforge), which brings in a slightly older version of numpy, that happens to be compatible with pymc3. It is a pain, but it works. I then don’t allow that version to be updated by conda.

---

<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:** [April 19, 2022, 12:21am UTC](https://discourse.pymc.io/t/pymc3-on-apple-m1-studio-numpy-error-float128/9184/3 "2022-04-19T00:21:17Z")

</div>

My understanding is that the there are a couple of different issues with M1/Monterey (e.g., [this thread](https://discourse.pymc.io/t/pymc3-linker-error/9034)). However, you seem to be using an older version of pymc (3.9.3), which is probably causing you to encounter some altogether different issues. As in that thread, I think the suggestion at this point is to transition to v4 with your new hardware. Installation instructions for the v4 beta are on [the conda-forge site](https://anaconda.org/conda-forge/pymc).

---

<div class="post-metadata">

**Author:** ![Bryan\_Palmer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/bryan_palmer/32/4682_2.png) [@Bryan\_Palmer](https://discourse.pymc.io/u/Bryan_Palmer)\
**Post date:** [April 19, 2022, 4:04am UTC](https://discourse.pymc.io/t/pymc3-on-apple-m1-studio-numpy-error-float128/9184/4 "2022-04-19T04:04:09Z")

</div>

Thanks for your quick response. Much appreciated.
