# Installation Error - VS Tools?

**URL:** <https://discourse.pymc.io/t/installation-error-vs-tools/4693>\
**Category:** Questions\
**Created:** [March 18, 2020, 2:20am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693 "2020-03-18T02:20:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marion2025](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Marion2025](https://discourse.pymc.io/u/Marion2025)\
**Post date:** [March 18, 2020, 2:20am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/1 "2020-03-18T02:20:06Z")

</div>

I get the following error when trying to install Pymc3 on windows. I’ve never had this error in past installations

After running the command

> conda install -c conda-forge pymc3

I get

> (MCMC) C:\Users\Alex\PycharmProjects\MCMC\>conda install -c conda-forge pymc3  
> Collecting package metadata (current\_repodata.json): done  
> Solving environment: done
> 
> ## Package Plan
> 
> environment location: C:\Users\Alex\Anaconda3\envs\MCMC
> 
> added / updated specs:  
> - pymc3
> 
> The following NEW packages will be INSTALLED:
> 
> arviz conda-forge/noarch::arviz-0.7.0-py\_0  
> bzip2 conda-forge/win-64::bzip2-1.0.8-hfa6e2cd\_2  
> cftime conda-forge/win-64::cftime-1.1.1-py37hbc2f12b\_0  
> curl conda-forge/win-64::curl-7.68.0-h4496350\_0  
> cycler conda-forge/noarch::cycler-0.10.0-py\_2  
> freetype conda-forge/win-64::freetype-2.10.0-h563cfd7\_1  
> h5py conda-forge/win-64::h5py-2.10.0-nompi\_py37h422b98e\_102  
> hdf4 conda-forge/win-64::hdf4-4.2.13-hf8e6fe8\_1003  
> hdf5 conda-forge/win-64::hdf5-1.10.5-nompi\_ha405e13\_1104  
> jpeg conda-forge/win-64::jpeg-9c-hfa6e2cd\_1001  
> kiwisolver conda-forge/win-64::kiwisolver-1.1.0-py37heaa310e\_1  
> krb5 conda-forge/win-64::krb5-1.16.4-hdd46e55\_0  
> libcurl conda-forge/win-64::libcurl-7.68.0-h4496350\_0  
> libgpuarray conda-forge/win-64::libgpuarray-0.7.6-hfa6e2cd\_1003  
> libnetcdf conda-forge/win-64::libnetcdf-4.7.3-nompi\_hc957ea6\_101  
> libpng conda-forge/win-64::libpng-1.6.37-h7602738\_0  
> libssh2 conda-forge/win-64::libssh2-1.8.2-h642c060\_2  
> mako conda-forge/noarch::mako-1.1.0-py\_0  
> markupsafe conda-forge/win-64::markupsafe-1.1.1-py37h8055547\_1  
> matplotlib-base conda-forge/win-64::matplotlib-base-3.2.0-py37h2981e6d\_1  
> netcdf4 conda-forge/win-64::netcdf4-1.5.3-nompi\_py37h0154fc0\_102  
> packaging conda-forge/noarch::packaging-20.1-py\_0  
> pandas conda-forge/win-64::pandas-1.0.2-py37h9b59f54\_0  
> patsy conda-forge/noarch::patsy-0.5.1-py\_0  
> pygpu conda-forge/win-64::pygpu-0.7.6-py37hc8d92b1\_1000  
> pymc3 conda-forge/noarch::pymc3-3.8-py\_0  
> pyparsing conda-forge/noarch::pyparsing-2.4.6-py\_0  
> pyreadline conda-forge/win-64::pyreadline-2.1-py37\_1001  
> python-dateutil conda-forge/noarch::python-dateutil-2.8.1-py\_0  
> pytz conda-forge/noarch::pytz-2019.3-py\_0  
> theano conda-forge/win-64::theano-1.0.4-py37h6538335\_1001  
> tk conda-forge/win-64::tk-8.6.10-hfa6e2cd\_0  
> tornado conda-forge/win-64::tornado-6.0.4-py37hfa6e2cd\_0  
> tqdm conda-forge/noarch::tqdm-4.43.0-py\_0  
> vs2015\_win-64 pkgs/main/win-64::vs2015\_win-64-14.0.25420-h55c1224\_11  
> xarray conda-forge/noarch::xarray-0.15.0-py\_0  
> zlib conda-forge/win-64::zlib-1.2.11-h2fa13f4\_1006
> 
> The following packages will be UPDATED:
> 
> certifi pkgs/main::certifi-2019.11.28-py37\_0 → conda-forge::certifi-2019.11.28-py37hc8dfbb8\_1
> 
> The following packages will be SUPERSEDED by a higher-priority channel:
> 
> ca-certificates pkgs/main::ca-certificates-2020.1.1-0 → conda-forge::ca-certificates-2019.11.28-hecc5488\_0  
> openssl pkgs/main::openssl-1.1.1e-he774522\_0 → conda-forge::openssl-1.1.1d-hfa6e2cd\_0
> 
> Proceed ([y]/n)?
> 
> Preparing transaction: done  
> Verifying transaction: done  
> Executing transaction: done
> 
> C:\Users\Alex\PycharmProjects\MCMC\>SET DISTUTILS\_USE\_SDK=1
> 
> C:\Users\Alex\PycharmProjects\MCMC\>SET MSSdk=1
> 
> C:\Users\Alex\PycharmProjects\MCMC\>SET platform=
> 
> C:\Users\Alex\PycharmProjects\MCMC\>IF /I [AMD64] == [amd64] set “platform=true”
> 
> C:\Users\Alex\PycharmProjects\MCMC\>IF /I == [amd64] set “platform=true”
> 
> C:\Users\Alex\PycharmProjects\MCMC\>if defined platform (set “VSREGKEY=HKEY\_LOCAL\_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0” ) ELSE (set “VSREGKEY=HKEY\_LOCAL\_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0” )
> 
> C:\Users\Alex\PycharmProjects\MCMC\>for /F “skip=2 tokens=2,\*” %A in (‘reg query “HKEY\_LOCAL\_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0” /v InstallDir’) do SET “VSINSTALLDIR=%B”  
> ERROR: The system was unable to find the specified registry key or value.
> 
> C:\Users\Alex\PycharmProjects\MCMC\>if “” == “” (set “VSINSTALLDIR=” )
> 
> C:\Users\Alex\PycharmProjects\MCMC\>if “” == “” (  
> ECHO “WARNING: Did not find VS in registry or in VS140COMNTOOLS env var - your compiler may not work”  
> GOTO End  
> )  
> “WARNING: Did not find VS in registry or in VS140COMNTOOLS env var - your compiler may not work”  
> The system cannot find the batch label specified - End

---

<div class="post-metadata">

**Author:** ![Marion2025](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Marion2025](https://discourse.pymc.io/u/Marion2025)\
**Post date:** [March 18, 2020, 3:11am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/2 "2020-03-18T03:11:26Z")

</div>

some more information. I have miniGW installed as detailed in this [post](https://discourse.pymc.io/t/install-pymc3-and-theano-windows-10/4260/4). Despite the VS error above, I can still import pymc3, but I get compile errors when now when trying to build a model

> You can find the C code in this temporary file: C:\Users\Alex\AppData\Local\Temp\theano\_compilation\_error\_qw3te2c1  
> Traceback (most recent call last):  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\code.py”, line 91, in runcode  
> exec(code, self.locals)  
> File “”, line 44, in   
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\distribution.py”, line 47, in **new**  
> return model.Var(name, dist, data, total\_size)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\model.py”, line 952, in Var  
> total\_size=total\_size, model=self)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\model.py”, line 1488, in **init**  
> self.logp\_elemwiset = distribution.logp(data)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\continuous.py”, line 519, in logp  
> sigma \> 0)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\tensor\var.py”, line 64, in **gt**  
> rval = theano.tensor.basic.gt(self, other)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\op.py”, line 670, in **call**  
> no\_recycling=)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\op.py”, line 955, in make\_thunk  
> no\_recycling)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\op.py”, line 858, in make\_c\_thunk  
> output\_storage=node\_output\_storage)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1217, in make\_thunk  
> keep\_lock=keep\_lock)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1157, in **compile**  
> keep\_lock=keep\_lock)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1624, in cthunk\_factory  
> key=key, lnk=self, keep\_lock=keep\_lock)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cmodule.py”, line 1189, in module\_from\_key  
> module = lnk.compile\_cmodule(location)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1527, in compile\_cmodule  
> preargs=preargs)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cmodule.py”, line 2411, in compile\_str  
> (status, compile\_stderr.replace(‘\n’, '. ')))  
> Exception: ('Compilation failed (return status=1): C:\Users\Alex\AppData\Local\Temp\ccJHhHnb.s: Assembler messages:\r. C:\Users\Alex\AppData\Local\Temp\ccJHhHnb.s:282: Error: invalid register for .seh\_savexmm\r. ', ‘[Elemwise{gt,no\_inplace}(\<TensorType(float64, vector)\>, \<TensorType(int8, (True,))\>)]’)

---

<div class="post-metadata">

**Author:** ![rosgori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/rosgori/32/1077_2.png) [@rosgori](https://discourse.pymc.io/u/rosgori)\
**Post date:** [March 20, 2020, 6:49am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/3 "2020-03-20T06:49:27Z")

</div>

Please run this code and tell us the errors you see

```python
import numpy as np
import pymc3 as pm

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

SEED = 3264602 # from random.org
np.random.seed(SEED)

N = 10000

μ_actual = np.array([1, -2])
Σ_actual = np.array([[0.5, -0.3],
                     [-0.3, 1.]])

x = np.random.multivariate_normal(μ_actual, Σ_actual, size=N)

with pm.Model() as model:
    packed_L = pm.LKJCholeskyCov('packed_L', n=2,
                                 eta=2., sd_dist=pm.HalfCauchy.dist(2.5))

    L = pm.expand_packed_triangular(2, packed_L)
    Σ = pm.Deterministic('Σ', L.dot(L.T))

    μ = pm.Normal('μ', 0., 10., shape=2,
                  testval=x.mean(axis=0))
    obs = pm.MvNormal('obs', μ, chol=L, observed=x)

with model:
    trace = pm.sample(random_seed=SEED, cores=4)

print(pm.summary(trace))

```

---

<div class="post-metadata">

**Author:** ![ahartikainen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ahartikainen/32/34_2.png) [@ahartikainen](https://discourse.pymc.io/u/ahartikainen)\
**Post date:** [March 20, 2020, 8:18am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/4 "2020-03-20T08:18:35Z")

</div>

Did you install mingw manually or only from conda? Manual install of mingw is not compatible with python.

Maybe try this workflow (you can skip Stan steps) [https://pystan.readthedocs.io/en/latest/windows.html](https://pystan.readthedocs.io/en/latest/windows.html)

---

<div class="post-metadata">

**Author:** ![Marion2025](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Marion2025](https://discourse.pymc.io/u/Marion2025)\
**Post date:** [March 22, 2020, 6:30am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/5 "2020-03-22T06:30:30Z")

</div>

Thanks for the tip here is what I see when I try to run this. I’ve researched this invalid register error and it appears to be happening for people who use Theano with MiniGW on Xeon chips

> You can find the C code in this temporary file: C:\Users\Alex\AppData\Local\Temp\theano\_compilation\_error\_9vub4jmd  
> Traceback (most recent call last):  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\code.py”, line 90, in runcode  
> exec(code, self.locals)  
> File “”, line 3, in   
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\distribution.py”, line 47, in **new**  
> return model.Var(name, dist, data, total\_size)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\model.py”, line 929, in Var  
> model=self)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\model.py”, line 1656, in **init**  
> transformed\_name, transform.apply(distribution), total\_size=total\_size)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\transforms.py”, line 112, in apply  
> return TransformedDistribution.dist(dist, self)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\distribution.py”, line 57, in dist  
> dist. **init** (\*args, \*\*kwargs)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\transforms.py”, line 141, in **init**  
> v = forward(FreeRV(name=“v”, distribution=dist))  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\model.py”, line 1370, in **init**  
> self.logp\_elemwiset = distribution.logp(self)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\multivariate.py”, line 1150, in logp  
> logp\_sd = self.sd\_dist.logp(sd\_vals).sum()  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\pymc3\distributions\continuous.py”, line 2412, in logp  
> value \>= 0, beta \> 0)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\tensor\var.py”, line 69, in **ge**  
> rval = theano.tensor.basic.ge(self, other)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\op.py”, line 670, in **call**  
> no\_recycling=)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\op.py”, line 955, in make\_thunk  
> no\_recycling)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\op.py”, line 858, in make\_c\_thunk  
> output\_storage=node\_output\_storage)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1217, in make\_thunk  
> keep\_lock=keep\_lock)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1157, in **compile**  
> keep\_lock=keep\_lock)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1624, in cthunk\_factory  
> key=key, lnk=self, keep\_lock=keep\_lock)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cmodule.py”, line 1189, in module\_from\_key  
> module = lnk.compile\_cmodule(location)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cc.py”, line 1527, in compile\_cmodule  
> preargs=preargs)  
> File “C:\Users\Alex\Anaconda3\envs\MCMC\lib\site-packages\theano\gof\cmodule.py”, line 2399, in compile\_str  
> (status, compile\_stderr.replace(‘\n’, '. ')))  
> Exception: ('Compilation failed (return status=1): C:\Users\Alex\AppData\Local\Temp\ccpUtpzk.s: Assembler messages:\r. C:\Users\Alex\AppData\Local\Temp\ccpUtpzk.s:282: Error: invalid register for .seh\_savexmm\r. ', ‘[Elemwise{ge,no\_inplace}(\<TensorType(float64, vector)\>, \<TensorType(int8, (True,))\>)]’)

---

<div class="post-metadata">

**Author:** ![Marion2025](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Marion2025](https://discourse.pymc.io/u/Marion2025)\
**Post date:** [March 22, 2020, 6:32am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/6 "2020-03-22T06:32:39Z")

</div>

Yes I’ve tried installing m2w64-toolchain through conda but I am getting a compile error. I believe it has to do with the fact I have a Xeon chip, I’ve seen alot of other users run into this invalid register error

---

<div class="post-metadata">

**Author:** ![ahartikainen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ahartikainen/32/34_2.png) [@ahartikainen](https://discourse.pymc.io/u/ahartikainen)\
**Post date:** [March 22, 2020, 7:18am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/7 "2020-03-22T07:18:28Z")

</div>

Ok, there might be possibility to use clang + libc++

```
conda install clang-dev libcxx -c conda-forge

```

Then I think you need to set `CC=clang` and `CXX=clang++`, but there is probably something needed so libcxx is used.

---

<div class="post-metadata">

**Author:** ![Marion2025](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Marion2025](https://discourse.pymc.io/u/Marion2025)\
**Post date:** [March 22, 2020, 8:02am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/8 "2020-03-22T08:02:04Z")

</div>

Let me give that a shot. Where do I set `CC=clang` and `CXX=clang++` ?

---

<div class="post-metadata">

**Author:** ![Marion2025](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Marion2025](https://discourse.pymc.io/u/Marion2025)\
**Post date:** [March 22, 2020, 8:19am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/9 "2020-03-22T08:19:00Z")

</div>

Actually it appears according to this post they fixed the bug in GCC, so I just need to get the released of MiniGW that has the fix…

[https://gcc.gnu.org/bugzilla/show\_bug.cgi?id=65782](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782)

---

<div class="post-metadata">

**Author:** ![Marion2025](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Marion2025](https://discourse.pymc.io/u/Marion2025)\
**Post date:** [March 22, 2020, 9:14am UTC](https://discourse.pymc.io/t/installation-error-vs-tools/4693/10 "2020-03-22T09:14:48Z")

</div>

Yes that was it! I was able to get it working (almost) using the MSYS2 installer, which installs a newer version of GCC than whats in the conda package. I was able to run your script once I changed cores=4 to cores=1, as I what getting broken pipeline errors with multiprocessing. Thanks for the help!
