Closed mdtdev closed 4 years ago
Hi @mdtdev, thanks for pinging in! I appreciate that you took the time to paste in the error trace. This helps a lot.
I have a suspicion that Theano, which PyMC3 is built on top of, needs some sort of C++ compiler behind-the-scenes. From prior exposure elsewhere, I keep hearing about a Visual Studio C++ compiler thingy. On macOS and Linux, there's clang/gcc respectively. But I'm not too well-versed in the Windows world. Do you know if there's a way to check if there is a C++ compiler available on those systems?
Thanks for the reply!
That is the weird part of this; the conda activate
step tosses out a lot of text that looks like it is searching for VS/Visual Studio, and MSYS, both of which are build environments in Windows 10 (I am not an expert on Windows, I know more about building on Linux or lower level architectures). I know that on the systems that work these tools are not installed. On the system that fails, I believe that MSYS is installed in a different environment. I checked and MSYS is not visible from the virtual environment I created with conda
following your instructions.
Actually I just went to the system that I have access to and on which the notebooks run. (The one that gives the warning message above.) I have confirmed that that system does NOT have any build toolchains on it. No Visual Studio, no m2w64-toolchain
from conda
, and no MSYS. For some reason that system falls back on the python implementations in that version of theano
.
As an alternate, I followed the instructions for installing (via conda
) the m2w64-toolchain
as suggested in the theano docs on the system that is failing. So I modified the virtual environment set up following your instructions by doing conda install m2w64-toolchain
and restarting things. But I still got the error. I can confirm that in the modified environment I have access to a full gcc
build environment, but theano
doesn't find it.
I agree that theano
wants a build toolchain, but I am stumped as to how to point it at the correct tools. But more importantly, why does theano
fall back to python implementations on 2 systems without build tools, but then fail to do this on the 3rd system? That is the weird part!
theano
says on two systems, "you should have a compiler but I will run without one anyway" but then on the third system it says "no compiler, no work". Despite all three being set up following the exact same steps...
Wow. That's a ton of work, and I want to affirm that you've done the right steps for debugging.
Seems like the tutorial is in a dire need of an upgrade to PyMC4, which eliminates the Theano dependency. However, I'm hesitant to do so until PyMC4 has a progress bar, and that depends on TFP implementing it (see this PyMC4 issue and this TFP issue -- posterior sampling via MCMC is where the progress bar comes in, and in pm4 this is delegated to TFP's library of MCMC samplers.
For usage and learning purposes, using a *nix system is the easiest way out, so macOS or one of the Linux flavours. And for learning, Binder or colab will be a better option, though with colab you will have to install all of the dependencies at the top of the notebook manually.
Stay tuned for updates to the repo, I'm working on a rewrite of the site so that they all take on the mkdocs-material feel (it should feel like Network Analysis Made Simple). Also, there'll be a focus on writing the data-generating model explicitly using scipy distributions, which will translate very closely to PyMC syntax (whether pm3 or pm4). That should help make learning how to use PyMC3/4 very easy!
I will close the issue for now, as I am afraid I don't have enough knowledge to go any deeper, and those issues sound like a problem with Theano on Windows. Theano has been handed over to the PyMC3 team (which I'm part of) to maintain, but without the level of familiarity with the codebase as the creators at MILA have, we are barely able to keep it bug-free as OSes and toolchains evolve, and are simply trying to keep it afloat for long enough until pm4 is finished development. For now, a *nix os is probably the right way to go, or to leverage Binder/Docker container to get things done. Having just gotten familiar enough with Docker to use it, I might add that as an option for running the notebooks.
Stay tuned for the updates!
I have set up according to the instructions given in the Github on three computers. On two of them, the tutorials work, on the third there is a fatal error importing
pymc3
. All three computers are up to date, fully patched Windows 10 boxes (I can try to provide more info if needed!). The problem is in the 02-Instructor-Parameter_estimation_hypothesis_testing notebook and happens when running theimport
block at top.On two of the computers, running this first block gives the warning message:
But things still work! All of the code blocks in the notebook execute, if slowly (for NUTS).
On the third computer, which was set up using the exact same steps, this is the error message that results (and the error is FATAL for using pymc3):
At this point, code not using
pymc3
works but allpymc3
blocks crash.Additionally, all three of the computers have trouble starting the environment for this tutorial (at Scipy) and print the following at the shell:
But for emphasis—this shell dump occurs on all 3 computers and two of those computers work, showing only the warning at the start! Based on this output, it seems there might be a mandatory dependency for MS Visual Studio being installed and in some particular location (on one of these machines, VS is around but not found!). On the working machines
pymc3
appears to use the python code fallback. For some reason it will not do this the third failing computer.I hope that these hidden dependencies can be fixed or spelled out, as we were unable to continue with the tutorial as this killed us completely. We can try to watch the replay later if we can get things working.
I am happy to provide more information if I can!