Version installation error with pymc3, arviz and theano

I was working with Spyder IDE with python version 3.8.5 and I was using pymc3 (can’t remember the exact version) and it was working fine and after upgrading scipy, spyder and python, everything went haywire. I spent the last 2 days trying to sort out this problem and everytime I install pymc3 and run the program either I get error with regards to theano and cxx__flag, or arviz with no attribute for geweke or then it gets an error with regards to ‘plots’.

Can someone tell me what is stable verions to use for pymc3, arviz, theano and theano-pymc?

Does this help? GitHub - pymc-devs/pymc3: Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Aesara

Well, I managed to get it to work using by upgrading python to 3.8.10 in spyder IDE and then I uninstalled and reinstalled pymc3 theano and arviz using the following line in anaconda terminal.

conda install -c conda-forge pymc3

But, now I get this error when it runs my code:

    sd_0 = pm.Normal('sd_0', mu=0, sd=1)

  File "D:\Anaconda\lib\site-packages\pymc3\distributions\distribution.py", line 121, in __new__
    dist = cls.dist(*args, **kwargs)

  File "D:\Anaconda\lib\site-packages\pymc3\distributions\distribution.py", line 130, in dist
    dist.__init__(*args, **kwargs)

  File "D:\Anaconda\lib\site-packages\pymc3\distributions\continuous.py", line 488, in __init__
    self.variance = 1.0 / self.tau

  File "D:\Anaconda\lib\site-packages\theano\tensor\var.py", line 176, in __rtruediv__
    return theano.tensor.basic.true_div(other, self)

  File "D:\Anaconda\lib\site-packages\theano\graph\op.py", line 253, in __call__
    compute_test_value(node)

  File "D:\Anaconda\lib\site-packages\theano\graph\op.py", line 126, in compute_test_value
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])

  File "D:\Anaconda\lib\site-packages\theano\graph\op.py", line 634, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)

  File "D:\Anaconda\lib\site-packages\theano\graph\op.py", line 600, in make_c_thunk
    outputs = cl.make_thunk(

  File "D:\Anaconda\lib\site-packages\theano\link\c\basic.py", line 1203, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(

  File "D:\Anaconda\lib\site-packages\theano\link\c\basic.py", line 1138, in __compile__
    thunk, module = self.cthunk_factory(

  File "D:\Anaconda\lib\site-packages\theano\link\c\basic.py", line 1634, in cthunk_factory
    module = get_module_cache().module_from_key(key=key, lnk=self)

  File "D:\Anaconda\lib\site-packages\theano\link\c\cmodule.py", line 1191, in module_from_key
    module = lnk.compile_cmodule(location)

  File "D:\Anaconda\lib\site-packages\theano\link\c\basic.py", line 1543, in compile_cmodule
    module = c_compiler.compile_str(

  File "D:\Anaconda\lib\site-packages\theano\link\c\cmodule.py", line 2546, in compile_str
    raise Exception(

Exception: ("Compilation failed (return status=1): C:\\Users\\----\\AppData\\Local\\Temp\\ccZOquFy.o: In function `run':\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:99: undefined reference to `__imp__Py_NoneStruct'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:124: undefined reference to `__imp_PyExc_ValueError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:130: undefined reference to `__imp_PyExc_RuntimeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:158: undefined reference to `__imp_PyExc_NotImplementedError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:195: undefined reference to `__imp__Py_NoneStruct'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:210: undefined reference to `__imp_PyExc_ValueError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:479: undefined reference to `__imp_PyExc_NotImplementedError'\r. C:\\Users\\----\\AppData\\Local\\Temp\\ccZOquFy.o: In function `_Py_INCREF':\r. D:/Anaconda/include/object.h:459: undefined reference to `__imp__Py_NoneStruct'\r. C:\\Users\\----\\AppData\\Local\\Temp\\ccZOquFy.o: In function `run':\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:485: undefined reference to `__imp_PyExc_RuntimeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:244: undefined reference to `__imp_PyExc_NotImplementedError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:265: undefined reference to `__imp_PyExc_RuntimeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:173: undefined reference to `__imp_PyExc_TypeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:179: undefined reference to `__imp_PyExc_RuntimeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:515: undefined reference to `__imp__Py_NoneStruct'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:514: undefined reference to `__imp__Py_NoneStruct'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:516: undefined reference to `__imp__Py_NoneStruct'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:259: undefined reference to `__imp_PyExc_TypeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:279: undefined reference to `__imp__Py_NoneStruct'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:294: undefined reference to `__imp_PyExc_ValueError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:328: undefined reference to `__imp_PyExc_NotImplementedError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:349: undefined reference to `__imp_PyExc_RuntimeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:216: undefined reference to `__imp_PyExc_RuntimeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:343: undefined reference to `__imp_PyExc_TypeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:300: undefined reference to `__imp_PyExc_RuntimeError'\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:397: undefined reference to `__imp_PyExc_RuntimeError'\r. C:\\Users\\----\\AppData\\Local\\Temp\\ccZOquFy.o: In function `instantiate':\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:550: undefined reference to `__imp_PyExc_TypeError'\r. C:\\Users\\----\\AppData\\Local\\Temp\\ccZOquFy.o: In function `_import_array':\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1480: undefined reference to `__imp_PyCapsule_Type'\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1481: undefined reference to `__imp_PyExc_RuntimeError'\r. C:\\Users\\----\\AppData\\Local\\Temp\\ccZOquFy.o: In function `PyInit_m31975b6dadb59d49af3f2b36405378825884299512ee0ed9081be33fa591d30d':\r. C:/Users/----/AppData/Local/Theano/compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_78_Stepping_3_GenuineIntel-3.8.10-64/tmpalwsztr6/mod.cpp:583: undefined reference to `__imp_PyExc_ImportError'\r. C:\\Users\\----\\AppData\\Local\\Temp\\ccZOquFy.o: In function `_import_array':\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1512: undefined reference to `__imp_PyExc_RuntimeError'\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1496: undefined reference to `__imp_PyExc_RuntimeError'\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1502: undefined reference to `__imp_PyExc_RuntimeError'\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1524: undefined reference to `__imp_PyExc_RuntimeError'\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1476: undefined reference to `__imp_PyExc_AttributeError'\r. D:/Anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1488: undefined reference to `__imp_PyExc_RuntimeError'\r. collect2.exe: error: ld returned 1 exit status\r. ", 'FunctionGraph(Elemwise{true_div,no_inplace}(TensorConstant{1.0}, TensorConstant{1.0}))')

I have recently had issues installing pymc via conda. Although I don’t like to mix package installers, I have found that using pip to install pymc always works! Might be worth a try.

1 Like

Well, What I did is the following lines and managed to fix my problem:

  1. I uninstalled and installed Anaconda
  2. Updated conda and anaconda
  3. Installed Pymc3 using conda install -c conda-forge pymc3 while keeping the same version of numpy, scipy and theano (Because the moment I updated numpy and scipy, it tends to cause inconsistencies with the files for Pymc3).
  4. I used this line to install theano-pymc conda install -c conda-forge theano-pymc

This is done using Windows.

1 Like

Didn’t work for me on macOS Big Sur. pip seems to have worked for me in this instance.