# Pymc3 linker error

**URL:** <https://discourse.pymc.io/t/pymc3-linker-error/9034>\
**Category:** v3\
**Tags:** bug, installation\
**Created:** [March 15, 2022, 2:45am UTC](https://discourse.pymc.io/t/pymc3-linker-error/9034 "2022-03-15T02:45:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arjunc12](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@arjunc12](https://discourse.pymc.io/u/arjunc12)\
**Post date:** [March 15, 2022, 2:45am UTC](https://discourse.pymc.io/t/pymc3-linker-error/9034/1 "2022-03-15T02:45:25Z")

</div>

Hi all,  
I have been using pymc3 for about a year. A few months ago I changed from an intel mac to an M1 mac. Suddenly, I can’t use pymc3 anymore. I keep getting the following error that I have no idea how to interpret:

> ## You can find the C code in this temporary file: /var/folders/dx/7qsz\_y4j3hzcbm5wnqnr8kdr0000gn/T/theano\_compilation\_error\_1ef8ki88
> 
> Exception Traceback (most recent call last)  
> in   
> 2  
> 3 # Priors for unknown model parameters  
> ----\> 4 beta1 = pm.Normal(“beta1”, mu=4, sigma=1)  
> 5 beta2 = pm.Normal(“beta2”, mu=9.8, sigma=1)  
> 6 sigma = pm.HalfNormal(“sigma”, sigma=1)
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/pymc3/distributions/distribution.py in **new** (cls, name, \*args, \*\*kwargs)  
> 119 dist = cls.dist(\*args, \*\*kwargs, shape=shape)  
> 120 else:  
> → 121 dist = cls.dist(\*args, \*\*kwargs)  
> 122 return model.Var(name, dist, data, total\_size, dims=dims)  
> 123
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/pymc3/distributions/distribution.py in dist(cls, \*args, \*\*kwargs)  
> 128 def dist(cls, \*args, \*\*kwargs):  
> 129 dist = object. **new** (cls)  
> → 130 dist. **init** (\*args, \*\*kwargs)  
> 131 return dist  
> 132
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/pymc3/distributions/continuous.py in **init** (self, mu, sigma, tau, sd, \*\*kwargs)  
> 486  
> 487 self.mean = self.median = self.mode = self.mu = mu = tt.as\_tensor\_variable(floatX(mu))  
> → 488 self.variance = 1.0 / self.tau  
> 489  
> 490 assert\_negative\_support(sigma, “sigma”, “Normal”)
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/tensor/var.py in **rtruediv** (self, other)  
> 174  
> 175 def **rtruediv** (self, other):  
> → 176 return theano.tensor.basic.true\_div(other, self)  
> 177  
> 178 def **rfloordiv** (self, other):
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/graph/op.py in **call** (self, \*inputs, \*\*kwargs)  
> 251  
> 252 if config.compute\_test\_value != “off”:  
> → 253 compute\_test\_value(node)  
> 254  
> 255 if self.default\_output is not None:
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/graph/op.py in compute\_test\_value(node)  
> 124  
> 125 # Create a thunk that performs the computation  
> → 126 thunk = node.op.make\_thunk(node, storage\_map, compute\_map, no\_recycling=)  
> 127 thunk.inputs = [storage\_map[v] for v in node.inputs]  
> 128 thunk.outputs = [storage\_map[v] for v in node.outputs]
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/graph/op.py in make\_thunk(self, node, storage\_map, compute\_map, no\_recycling, impl)  
> 632 )  
> 633 try:  
> → 634 return self.make\_c\_thunk(node, storage\_map, compute\_map, no\_recycling)  
> 635 except (NotImplementedError, MethodNotDefined):  
> 636 # We requested the c code, so don’t catch the error.
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/graph/op.py in make\_c\_thunk(self, node, storage\_map, compute\_map, no\_recycling)  
> 598 print(f"Disabling C code for {self} due to unsupported float16")  
> 599 raise NotImplementedError(“float16”)  
> → 600 outputs = cl.make\_thunk(  
> 601 input\_storage=node\_input\_storage, output\_storage=node\_output\_storage  
> 602 )
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/link/c/basic.py in make\_thunk(self, input\_storage, output\_storage, storage\_map)  
> 1201 “”"  
> 1202 init\_tasks, tasks = self.get\_init\_tasks()  
> → 1203 cthunk, module, in\_storage, out\_storage, error\_storage = self. **compile** (  
> 1204 input\_storage, output\_storage, storage\_map  
> 1205 )
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/link/c/basic.py in **compile** (self, input\_storage, output\_storage, storage\_map)  
> 1136 input\_storage = tuple(input\_storage)  
> 1137 output\_storage = tuple(output\_storage)  
> → 1138 thunk, module = self.cthunk\_factory(  
> 1139 error\_storage,  
> 1140 input\_storage,
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/link/c/basic.py in cthunk\_factory(self, error\_storage, in\_storage, out\_storage, storage\_map)  
> 1632 for node in self.node\_order:  
> 1633 node.op.prepare\_node(node, storage\_map, None, “c”)  
> → 1634 module = get\_module\_cache().module\_from\_key(key=key, lnk=self)  
> 1635  
> 1636 vars = self.inputs + self.outputs + self.orphans
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/link/c/cmodule.py in module\_from\_key(self, key, lnk)  
> 1189 try:  
> 1190 location = dlimport\_workdir(self.dirname)  
> → 1191 module = lnk.compile\_cmodule(location)  
> 1192 name = module. **file**  
> 1193 assert name.startswith(location)
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/link/c/basic.py in compile\_cmodule(self, location)  
> 1541 try:  
> 1542 \_logger.debug(f"LOCATION {location}")  
> → 1543 module = c\_compiler.compile\_str(  
> 1544 module\_name=mod.code\_hash,  
> 1545 src\_code=src\_code,
> 
> ~/opt/anaconda3/envs/cmpinf2120/lib/python3.9/site-packages/theano/link/c/cmodule.py in compile\_str(module\_name, src\_code, location, include\_dirs, lib\_dirs, libs, preargs, py\_module, hide\_symbols)  
> 2544 # difficult to read.  
> 2545 compile\_stderr = compile\_stderr.replace(“\n”, ". “)  
> → 2546 raise Exception(  
> 2547 f"Compilation failed (return status={status}): {compile\_stderr}”  
> 2548 )
> 
> Exception: ("Compilation failed (return status=1): ld: unsupported tapi file type ‘!tapi-tbd’ in YAML file ‘/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd’ for architecture x86\_64. clang-12: error: linker command failed with exit code 1 (use -v to see invocation). ", ‘FunctionGraph(Elemwise{true\_div,no\_inplace}(TensorConstant{1.0}, TensorConstant{1.0}))’)

I created an anaconda environment with pymc3 using the exact directions instructed for M1 macs. I have the latest version of xcode installed. I am on the latest version of MacOS monterrey.

Please let me know if you need any more information about my anaconda version, my python version, my gcc/clang version, etc.

If anyone can help me, I cannot begin to tell you how much this would be appreciated. I am really really worried.

I apologize if this is a really stupid question as well or if I haven’t provided enough help. I am just really anxious about this, please help me!

Arjun

---

<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:** [March 15, 2022, 3:05am UTC](https://discourse.pymc.io/t/pymc3-linker-error/9034/2 "2022-03-15T03:05:06Z")

</div>

[This issue](https://github.com/pymc-devs/pymc/issues/5536) seems related?

---

<div class="post-metadata">

**Author:** ![arjunc12](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@arjunc12](https://discourse.pymc.io/u/arjunc12)\
**Post date:** [March 15, 2022, 12:12pm UTC](https://discourse.pymc.io/t/pymc3-linker-error/9034/3 "2022-03-15T12:12:42Z")

</div>

Yes, looks like the same error. PyMC3 was working for me a month ago and then it just stopped and looked like that.

Do you know if v4 developed on/for the M4 macs with monterrey?

Alternately, is there any way to check that my gcc/clang version are correct and functional?

---

<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:** [March 15, 2022, 1:42pm UTC](https://discourse.pymc.io/t/pymc3-linker-error/9034/4 "2022-03-15T13:42:44Z")

</div>

I would post to that issue and a) let everyone know you are experiencing the same problem and b) ask about your configuration/installation. You can also try out the v4 beta that has been released.

---

<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:** [March 16, 2022, 2:38am UTC](https://discourse.pymc.io/t/pymc3-linker-error/9034/5 "2022-03-16T02:38:28Z")

</div>

Looks like things were resolved, yes? Moving to PyMC v4 took care of your problem?

---

<div class="post-metadata">

**Author:** ![arjunc12](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@arjunc12](https://discourse.pymc.io/u/arjunc12)\
**Post date:** [March 16, 2022, 2:55am UTC](https://discourse.pymc.io/t/pymc3-linker-error/9034/6 "2022-03-16T02:55:37Z")

</div>

Yes it did! Thanks for pointing me to that thread!

Installing v4 from source worked, but so did installing pymc (as opposed to pymc3) from conda-forge.

I’ll still be coming to office hours on Friday for some smaller questions. But my massive ball of stress is gone!
