-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation Instructions for Pymc3 on Windows 10 using Anaconda 3 #4937
Comments
Before I go through the details, here are two suggestions:
|
Is that |
Thanks @michaelosthege for the initial feedback - I will include those changes. Collapsible sections are a great idea and thanks for showing how it is done! @ricardoV94 yes it is (and thanks for the question) - what this means (upon researching I found) is that I found a solution: install @michaelosthege I will add Update: ``blas |
this looks like a really detailed and helpful way of explaining things!! thanks! we do have a lot of windows installation problems. A lil suggestion that you can think about, although wait to see what others think but: a few of the steps seem to be things that are more to do with requirements for a working "anaconda and jupyter" which can probably be a separate subsection. as in "here's the guide to install pymc3 on windows: 1. If you don't have a working anaconda/are not familiar with condo envs check {insert link}" and perhaps after some suggestions we can make a small installation troubleshooting guide, I think there are some common import errors that happen, so users don't have to dig through old issues and are aware of common troubles, it can be an FAQ/ troubleshooting guide thing, a lot of libraries nowadays have those I think. the docs team might have a different approach about it, here's just my two cents!! |
@mjhajharia thank you for the feedback and the suggestions. I included Jupyter as a way to test as it reflects my Windows bias rather than my comfort with command line. @michaelosthege has already proposed a way to test the Pymc3 installation using the command line and I will change that in the document. I agree that the sub-sections to installing Pymc3 and testing it are many. I hope that with my own experience, I can help others avoid the mistakes that I did. Please share any additional feedback. |
@michaelosthege @ricardoV94 Just an update on the Warning associated with Theano and Blas: What I found is the folliwing:
@michaelosthege Any idea why this is happening? Sree |
My experience with this whole installation stuff is just empirical. I have very little understanding of how these dependencies interact with each other. Over here (and linked there) are ongoing activities to fix the Aesara and PyMC3 conda recipes: #4932. Again I'm not involved with making these changes right now. I just happen to be someone with a Windows machine who found a local optimum of more or less reproducible installation instructions. |
@michaelosthege thanks for getting back Michael! I will check the link and understand more. It is good that there is a very good working setup with 3.7.9 that I found on Windows 10 and you have some thing similar. Hopefully between these two variations we can have some stability. Might be wishful thinking on my part! In the documentation, the Python=3.7.9 and Python=3.8.8 and their respective environments can be provided which may help out other users. |
@michaelosthege @ricardoV94 the installation instructions are no good. On a new machine I tried to follow these instructions and create a working installation of
I have to do more investigation into why this is failing for Windows 10 and understand this seemingly random behavior |
@michaelosthege @ricardoV94 I think I have discovered a working solution to installing and running
On a whim, I installed RTools mingw tool chain and used it, since it uses When RTools was installed, I allowed that to be on the System PATH and to be discovered as the main After I restarted each of the Windows 10 machines, I could run all of the examples from the Pymc3 Getting Started page successfully without any These invalid register errors crop up only with Lastly, is there anything that can be done to precisely identify the problem and find a proper solution? I have a solution, but this is a stop gap at best. |
@sreedat can you post the exact install commands you used? |
@twiecki After posting this I could make my
|
@twiecki I have successfully repeated the exact process of using RTools as the preferred Here are the two environment.yml files for both of what I have tested to date when using RTools Environment_pymc3_py38RT.ymlname: pm3py38 channels: - conda-forge - defaults dependencies: - anyio=3.3.0=py38haa244fe_0 - argon2-cffi=20.1.0=py38h294d835_2 - async_generator=1.10=py_0 - attrs=21.2.0=pyhd8ed1ab_0 - babel=2.9.1=pyh44b312d_0 - backcall=0.2.0=pyh9f0ad1d_0 - backports=1.0=py_2 - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0 - blas=1.0=mkl - bleach=4.0.0=pyhd8ed1ab_0 - brotlipy=0.7.0=py38h294d835_1001 - ca-certificates=2021.5.30=h5b45459_0 - cairo=1.16.0=hb19e0ff_1008 - certifi=2021.5.30=py38haa244fe_0 - cffi=1.14.6=py38hd8c33c5_0 - chardet=4.0.0=py38haa244fe_1 - charset-normalizer=2.0.0=pyhd8ed1ab_0 - colorama=0.4.4=pyh9f0ad1d_0 - cryptography=3.4.7=py38hd7da0ea_0 - debugpy=1.4.1=py38h885f38d_0 - decorator=5.0.9=pyhd8ed1ab_0 - defusedxml=0.7.1=pyhd8ed1ab_0 - entrypoints=0.3=pyhd8ed1ab_1003 - expat=2.4.1=h39d44d4_0 - font-ttf-dejavu-sans-mono=2.37=hab24e00_0 - font-ttf-inconsolata=3.000=h77eed37_0 - font-ttf-source-code-pro=2.038=h77eed37_0 - font-ttf-ubuntu=0.83=hab24e00_0 - fontconfig=2.13.1=h1989441_1005 - fonts-conda-ecosystem=1=0 - fonts-conda-forge=1=0 - freetype=2.10.4=h546665d_1 - fribidi=1.0.10=h8d14728_0 - getopt-win32=0.1=h8ffe710_0 - gettext=0.19.8.1=h1a89ca6_1005 - graphite2=1.3.13=1000 - graphviz=2.48.0=hefbd956_0 - gts=0.7.6=h7c369d9_2 - harfbuzz=2.8.2=hc601d6f_0 - icu=68.1=h0e60522_0 - idna=3.1=pyhd3deb0d_0 - importlib-metadata=4.6.3=py38haa244fe_0 - intel-openmp=2021.3.0=h57928b3_3372 - ipykernel=6.0.3=py38h43734a8_0 - ipython=7.26.0=py38h595d716_0 - ipython_genutils=0.2.0=py_1 - jbig=2.1=h8d14728_2003 - jedi=0.18.0=py38haa244fe_2 - jinja2=3.0.1=pyhd8ed1ab_0 - jpeg=9d=h8ffe710_0 - json5=0.9.5=pyh9f0ad1d_0 - jsonschema=3.2.0=pyhd8ed1ab_3 - jupyter_client=6.1.12=pyhd8ed1ab_0 - jupyter_core=4.7.1=py38haa244fe_0 - jupyter_server=1.10.2=pyhd8ed1ab_0 - jupyterlab=3.1.4=pyhd8ed1ab_0 - jupyterlab_pygments=0.1.2=pyh9f0ad1d_0 - jupyterlab_server=2.6.2=pyhd8ed1ab_0 - lerc=2.2.1=h0e60522_0 - libblas=3.9.0=1_h8933c1f_netlib - libcblas=3.9.0=5_hd5c7e75_netlib - libdeflate=1.7=h8ffe710_5 - libffi=3.3=h0e60522_2 - libgd=2.3.2=h138e682_0 - libglib=2.68.3=h1e62bf3_0 - libiconv=1.16=he774522_0 - liblapack=3.9.0=5_hd5c7e75_netlib - libpng=1.6.37=h1d00b33_2 - libpython=2.0=py38haa244fe_1 - libsodium=1.0.18=h8d14728_1 - libtiff=4.3.0=h0c97f57_1 - libwebp=1.2.0=h57928b3_0 - libwebp-base=1.2.0=h8ffe710_2 - libxcb=1.13=hcd874cb_1003 - libxml2=2.9.12=hf5bbc77_0 - llvmlite=0.36.0=py38h57a6900_0 - lz4-c=1.9.3=h8ffe710_1 - m2w64-gcc-libgfortran=5.3.0=6 - m2w64-gcc-libs=5.3.0=7 - m2w64-gcc-libs-core=5.3.0=7 - m2w64-gmp=6.1.0=2 - m2w64-libwinpthread-git=5.0.0.4634.697f757=2 - markupsafe=2.0.1=py38h294d835_0 - matplotlib-inline=0.1.2=pyhd8ed1ab_2 - mistune=0.8.4=py38h294d835_1004 - mkl=2021.3.0=haa95532_524 - mkl-service=2.4.0=py38h294d835_0 - msys2-conda-epoch=20160418=1 - nbclassic=0.3.1=pyhd8ed1ab_1 - nbclient=0.5.3=pyhd8ed1ab_0 - nbconvert=6.1.0=py38haa244fe_0 - nbformat=5.1.3=pyhd8ed1ab_0 - nest-asyncio=1.5.1=pyhd8ed1ab_0 - notebook=6.4.2=pyha770c72_0 - numba=0.53.1=py38h99fac5f_1 - numpy=1.21.1=py38h09042cb_0 - openssl=1.1.1k=h8ffe710_1 - packaging=21.0=pyhd8ed1ab_0 - pandoc=2.14.1=h8ffe710_0 - pandocfilters=1.4.2=py_1 - pango=1.48.7=hd84fcdd_0 - parso=0.8.2=pyhd8ed1ab_0 - pcre=8.45=h0e60522_0 - pickleshare=0.7.5=py_1003 - pip=21.2.3=pyhd8ed1ab_0 - pixman=0.40.0=h8ffe710_0 - prometheus_client=0.11.0=pyhd8ed1ab_0 - prompt-toolkit=3.0.19=pyha770c72_0 - pthread-stubs=0.4=hcd874cb_1001 - pycparser=2.20=pyh9f0ad1d_2 - pygments=2.9.0=pyhd8ed1ab_0 - pyopenssl=20.0.1=pyhd8ed1ab_0 - pyparsing=2.4.7=pyh9f0ad1d_0 - pyrsistent=0.17.3=py38h294d835_2 - pysocks=1.7.1=py38haa244fe_3 - python=3.8.10=h7840368_1_cpython - python-dateutil=2.8.2=pyhd8ed1ab_0 - python-graphviz=0.17=pyhaef67bd_0 - python_abi=3.8=2_cp38 - pytz=2021.1=pyhd8ed1ab_0 - pywin32=301=py38h294d835_0 - pywinpty=1.1.3=py38hd3f51b4_0 - pyzmq=22.2.1=py38h09162b1_0 - requests=2.26.0=pyhd8ed1ab_0 - requests-unixsocket=0.2.0=py_0 - scipy=1.7.1=py38ha1292f7_0 - send2trash=1.7.1=pyhd8ed1ab_0 - setuptools=49.6.0=py38haa244fe_3 - six=1.16.0=pyh6c4a22f_0 - sniffio=1.2.0=py38haa244fe_1 - sqlite=3.36.0=h8ffe710_0 - terminado=0.10.1=py38haa244fe_0 - testpath=0.5.0=pyhd8ed1ab_0 - tornado=6.1=py38h294d835_1 - traitlets=5.0.5=py_0 - ucrt=10.0.20348.0=h57928b3_0 - urllib3=1.26.6=pyhd8ed1ab_0 - vc=14.2=hb210afc_5 - vs2015_runtime=14.29.30037=h902a5da_5 - wcwidth=0.2.5=pyh9f0ad1d_2 - webencodings=0.5.1=py_1 - websocket-client=0.57.0=py38haa244fe_4 - wheel=0.36.2=pyhd3deb0d_0 - win_inet_pton=1.1.0=py38haa244fe_2 - wincertstore=0.2=py38haa244fe_1006 - winpty=0.4.3=4 - xorg-kbproto=1.0.7=hcd874cb_1002 - xorg-libice=1.0.10=hcd874cb_0 - xorg-libsm=1.2.3=hcd874cb_1000 - xorg-libx11=1.7.2=hcd874cb_0 - xorg-libxau=1.0.9=hcd874cb_0 - xorg-libxdmcp=1.1.3=hcd874cb_0 - xorg-libxext=1.3.4=hcd874cb_1 - xorg-libxpm=3.5.13=hcd874cb_0 - xorg-libxt=1.2.1=hcd874cb_2 - xorg-xextproto=7.3.0=hcd874cb_1002 - xorg-xproto=7.0.31=hcd874cb_1007 - xz=5.2.5=h62dcd97_1 - zeromq=4.3.4=h0e60522_0 - zipp=3.5.0=pyhd8ed1ab_0 - zlib=1.2.11=h62dcd97_1010 - zstd=1.5.0=h6255e5f_0 - pip: - arviz==0.11.2 - cachetools==4.2.2 - cftime==1.5.0 - cycler==0.10.0 - dill==0.3.4 - fastprogress==1.0.0 - filelock==3.0.12 - formulae==0.1.3 - kiwisolver==1.3.1 - matplotlib==3.4.2 - netcdf4==1.5.7 - pandas==1.3.1 - patsy==0.5.1 - pillow==8.3.1 - pymc3==3.11.2 - semver==2.13.0 - theano-pymc==1.1.2 - typing-extensions==3.10.0.0 - xarray==0.19.0Environment_pymc3_py39RT.ymlname: pm3py39 channels: - conda-forge - defaults dependencies: - argon2-cffi=20.1.0=py39hb82d6ee_2 - async_generator=1.10=py_0 - attrs=21.2.0=pyhd8ed1ab_0 - backcall=0.2.0=pyh9f0ad1d_0 - backports=1.0=py_2 - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0 - blas=1.0=mkl - bleach=4.0.0=pyhd8ed1ab_0 - ca-certificates=2021.5.30=h5b45459_0 - cairo=1.16.0=hb19e0ff_1008 - cffi=1.14.6=py39h0878f49_0 - colorama=0.4.4=pyh9f0ad1d_0 - debugpy=1.4.1=py39h415ef7b_0 - decorator=5.0.9=pyhd8ed1ab_0 - defusedxml=0.7.1=pyhd8ed1ab_0 - entrypoints=0.3=pyhd8ed1ab_1003 - expat=2.4.1=h39d44d4_0 - font-ttf-dejavu-sans-mono=2.37=hab24e00_0 - font-ttf-inconsolata=3.000=h77eed37_0 - font-ttf-source-code-pro=2.038=h77eed37_0 - font-ttf-ubuntu=0.83=hab24e00_0 - fontconfig=2.13.1=h1989441_1005 - fonts-conda-ecosystem=1=0 - fonts-conda-forge=1=0 - freetype=2.10.4=h546665d_1 - fribidi=1.0.10=h8d14728_0 - getopt-win32=0.1=h8ffe710_0 - gettext=0.19.8.1=h1a89ca6_1005 - graphite2=1.3.13=1000 - graphviz=2.48.0=hefbd956_0 - gts=0.7.6=h7c369d9_2 - harfbuzz=2.9.0=hc601d6f_0 - icu=68.1=h0e60522_0 - importlib-metadata=4.6.4=py39hcbf5309_0 - intel-openmp=2021.3.0=h57928b3_3372 - ipykernel=6.2.0=py39h832f523_0 - ipython=7.26.0=py39h832f523_0 - ipython_genutils=0.2.0=py_1 - jbig=2.1=h8d14728_2003 - jedi=0.18.0=py39hcbf5309_2 - jinja2=3.0.1=pyhd8ed1ab_0 - jpeg=9d=h8ffe710_0 - jsonschema=3.2.0=pyhd8ed1ab_3 - jupyter_client=6.1.12=pyhd8ed1ab_0 - jupyter_core=4.7.1=py39hcbf5309_0 - jupyterlab_pygments=0.1.2=pyh9f0ad1d_0 - lerc=2.2.1=h0e60522_0 - libblas=3.9.0=1_h8933c1f_netlib - libcblas=3.9.0=5_hd5c7e75_netlib - libdeflate=1.7=h8ffe710_5 - libffi=3.3=h0e60522_2 - libgd=2.3.2=h138e682_0 - libglib=2.68.4=h1e62bf3_0 - libiconv=1.16=he774522_0 - liblapack=3.9.0=5_hd5c7e75_netlib - libpng=1.6.37=h1d00b33_2 - libpython=2.0=py39hcbf5309_1 - libsodium=1.0.18=h8d14728_1 - libtiff=4.3.0=h0c97f57_1 - libwebp=1.2.1=h57928b3_0 - libwebp-base=1.2.1=h8ffe710_0 - libxcb=1.13=hcd874cb_1003 - libxml2=2.9.12=hf5bbc77_0 - llvmlite=0.36.0=py39ha0cd8c8_0 - lz4-c=1.9.3=h8ffe710_1 - m2w64-gcc-libgfortran=5.3.0=6 - m2w64-gcc-libs=5.3.0=7 - m2w64-gcc-libs-core=5.3.0=7 - m2w64-gmp=6.1.0=2 - m2w64-libwinpthread-git=5.0.0.4634.697f757=2 - markupsafe=2.0.1=py39hb82d6ee_0 - matplotlib-inline=0.1.2=pyhd8ed1ab_2 - mistune=0.8.4=py39hb82d6ee_1004 - mkl=2021.3.0=haa95532_524 - mkl-service=2.4.0=py39hb82d6ee_0 - msys2-conda-epoch=20160418=1 - nbclient=0.5.4=pyhd8ed1ab_0 - nbconvert=6.1.0=py39hcbf5309_0 - nbformat=5.1.3=pyhd8ed1ab_0 - nest-asyncio=1.5.1=pyhd8ed1ab_0 - notebook=6.4.3=pyha770c72_0 - numba=0.53.1=py39hb8cd55e_1 - numpy=1.21.2=py39h6635163_0 - openssl=1.1.1k=h8ffe710_1 - packaging=21.0=pyhd8ed1ab_0 - pandoc=2.14.1=h8ffe710_0 - pandocfilters=1.4.2=py_1 - pango=1.48.9=hd84fcdd_0 - parso=0.8.2=pyhd8ed1ab_0 - pcre=8.45=h0e60522_0 - pickleshare=0.7.5=py_1003 - pip=21.2.4=pyhd8ed1ab_0 - pixman=0.40.0=h8ffe710_0 - prometheus_client=0.11.0=pyhd8ed1ab_0 - prompt-toolkit=3.0.19=pyha770c72_0 - pthread-stubs=0.4=hcd874cb_1001 - pycparser=2.20=pyh9f0ad1d_2 - pygments=2.10.0=pyhd8ed1ab_0 - pyparsing=2.4.7=pyh9f0ad1d_0 - pyrsistent=0.17.3=py39hb82d6ee_2 - python=3.9.6=h7840368_1_cpython - python-dateutil=2.8.2=pyhd8ed1ab_0 - python-graphviz=0.17=pyhaef67bd_0 - python_abi=3.9=2_cp39 - pywin32=301=py39hb82d6ee_0 - pywinpty=1.1.3=py39h99910a6_0 - pyzmq=22.2.1=py39he46f08e_0 - scipy=1.7.1=py39hc0c34ad_0 - send2trash=1.8.0=pyhd8ed1ab_0 - setuptools=57.4.0=py39hcbf5309_0 - six=1.16.0=pyh6c4a22f_0 - sqlite=3.36.0=h8ffe710_0 - terminado=0.11.1=py39hcbf5309_0 - testpath=0.5.0=pyhd8ed1ab_0 - tornado=6.1=py39hb82d6ee_1 - traitlets=5.0.5=py_0 - tzdata=2021a=he74cb21_1 - ucrt=10.0.20348.0=h57928b3_0 - vc=14.2=hb210afc_5 - vs2015_runtime=14.29.30037=h902a5da_5 - wcwidth=0.2.5=pyh9f0ad1d_2 - webencodings=0.5.1=py_1 - wheel=0.37.0=pyhd8ed1ab_1 - winpty=0.4.3=4 - xorg-kbproto=1.0.7=hcd874cb_1002 - xorg-libice=1.0.10=hcd874cb_0 - xorg-libsm=1.2.3=hcd874cb_1000 - xorg-libx11=1.7.2=hcd874cb_0 - xorg-libxau=1.0.9=hcd874cb_0 - xorg-libxdmcp=1.1.3=hcd874cb_0 - xorg-libxext=1.3.4=hcd874cb_1 - xorg-libxpm=3.5.13=hcd874cb_0 - xorg-libxt=1.2.1=hcd874cb_2 - xorg-xextproto=7.3.0=hcd874cb_1002 - xorg-xproto=7.0.31=hcd874cb_1007 - xz=5.2.5=h62dcd97_1 - zeromq=4.3.4=h0e60522_0 - zipp=3.5.0=pyhd8ed1ab_0 - zlib=1.2.11=h62dcd97_1010 - zstd=1.5.0=h6255e5f_0 - pip: - arviz==0.11.2 - cachetools==4.2.2 - cftime==1.5.0 - cycler==0.10.0 - dill==0.3.4 - fastprogress==1.0.0 - filelock==3.0.12 - kiwisolver==1.3.1 - matplotlib==3.4.3 - netcdf4==1.5.7 - pandas==1.3.2 - patsy==0.5.1 - pillow==8.3.1 - pymc3==3.11.3 - pytz==2021.1 - semver==2.13.0 - theano-pymc==1.1.2 - typing-extensions==3.10.0.0 - xarray==0.19.0 |
@twiecki upon further testing I did notice the following warning in I do not get this warning in |
@twiecki I was able to resolve this warning, although I do not understand why, by installing
The time for sampling is interesting to note: |
Hi All, Just wanted to add some additional instructions for the Windows Installation Guide. I just wanted to add that even using RTools with gcc 8.3.0, there seems to be a problem with compilation (same error as above, "invalid register ...") for Xeon users on Windows 10. GCC seems to have fixed this bug in version 9.0+ (see the discourse post that gave me the idea to try other compilers (including clang and VS Tools). To get gcc working properly on Windows 10 with Xeon processors:
|
Thanks @curtywang. |
Yes, but the msys2 version of gcc on conda repos for Windows has stalled at 5.3.0. |
Any idea why m2w64 doesn't work for you? |
It's the same compilation error as above, even if I remove everything except the m2w64 paths from PATH and check the CXX being used. If I use clang or MSVC, theano-pymc is able to compile models (but not use any optimizations). I suspect it has to do with GCC and Windows more than anything, given that even numpy seems to have faced this problem for GCC 8.3.0. The version of GCC on my MSYS2 install now is 10.3.0. |
@sreedat this was the only approach that managed to produce at least a half working pymc3 installation on my Windows 10. However, it seems even this approach produces an unstable installation, with some things working some not. Doing a quick check reproducing https://towardsdatascience.com/bayesian-statistics-101-4c4bc5fde1e1 examples the standard linear regressions work, but the binomial examples do not, neither in the GLM mode nor when implementing from scratch. Both give 'Compilation failed (return status=1): C:\Users\\AppData\Local\Temp\ccKUWQjU.s: Assembler messages:\r. C:\Users\\AppData\Local\Temp\ccKUWQjU.s:367: Error: invalid register for .seh_savexmm\r. ', 'FunctionGraph(Elemwise{eq,no_inplace}(TensorConstant{[0 0 1 1 0..1 1 1 0 1]}, <TensorType(int8, (True,))>))'" error. Install:
|
Let me try the binomial example and see if it works for the MSYS2 GCC 10.3.0 setup. |
@zperko On the MSYS2 GCC 10.3.0 setup, the Bernoulli model seems to have worked:
outputs just the usual
Is able to run the sampler in whole:
|
@curtywang Thanks for the fast reply and try. I've tried to replicate your solution, installing msys2, but in runtime now all examples give a "cc1plux.exe system error", complaining about not finding zlib1.dll. Despite the dll file being in /mingw64/bin. Really weird. |
@curtywang Managed to solve it, thanks for the help. Apparently the issue was with theano config not using the msys g++ compiler, was still pointing to my Strawberry install. |
@twiecki I just confirmed that it might just be a newer Intel microarch problem for Windows m2w64-toolchain. I had another user who has a Ice Lake (Core i5-1035G4) and I myself have a Xeon Silver 4216 (Cascade Lake). It seems as though the msys2 g++ will solve the problem. @zperko I have the same problem, Windows multiprocessing is slower than just running the sampler singlethreaded, sometimes. |
I've been trying to get this working on Win11 using the advice above, but I run into compilation errors:
This is having installed m2w64-toolchain from the msys2 repository. This is a Surface Pro 8, so 11th gen core i7. |
Sorry accidentally closed the issue. Reopening. |
@jedludlow love to hear it! |
We now support the most recent aesara version on @jedludlow Is there a way for you to test that this fix isn't required anymore without a pip/conda release? |
@twiecki, yes, there is. Here's how to do it. First, make sure to rename any name: pymc_env
channels:
- conda-forge
dependencies:
- python
- libpython
- m2w64-toolchain
- mkl-service
- numba
- pip
- pip:
- "git+https://github.com/pymc-devs/pymc.git" Save this conda env create which will create the environment and install Creating this environment and activating it produces a working PyMC install for me with no compiler failures or the Additional diagnostics can be obtained from this command (after activating the python -m aesara.misc.check_blas That will produce a long printout of BLAS diagnostics and a performance check, but the important line for us today is the one that talks about Aesara BLAS flags. Look for something like like this:
If MKL is being auto-discovered appropriately, the |
@jedludlow Thanks for confirming, so we can simplify the installation instructions even more. Want to edit them accordingly? |
@twiecki, I'd be happy to update the installation instructions, but I would appreciate some input on which simplifications the community would suggest.
|
They should be written assuming
I would remove them. |
@jedludlow I gave it a shot. |
@twiecki I made just a couple of additional edits to remove any traces of pip or the PyMC3 option. I assume that was your goal. |
@jedludlow are the changes to |
@hectormz, I suspect there will be complex and custom system configurations that confuse Aesara's automatic BLAS detection logic, so I would expect that sometimes manual BLAS flag setting will still be required. I would suggest trying things out on your configuration, and let us know how it goes! |
@jedludlow I can report successful installation of |
@jedludlow |
@jedludlow I'm always happy to be a guinea pig! |
@jedludlow @twiecki @fonnesbeck see this issue I have opened on testing the latest version of To provide a brief synopsis: Using the same package environments (as nearly exact as possible) I tested the latest versions of Both laptops have the same RAM (8GB) and Ananconda was the only application running at that time. If any of you could try to replicate and see what happens it would be very helpful |
We now have a conda-forge package that should install mkl if you just do |
@twiecki I can confirm installation and binding of BLAS to MKL on Windows10 using the instructions @jedludlow provided |
@sreedat I'm interested in the case that's not following @jedludlow's instrucitons but jsut creating a fresh env and running: |
I tried a fresh install on Windows 10 by running The "fancy install" instructions currently on the windows installation guide don't seem to work, though. I tried omitting m2w64-toolchain as suggested and instead put g++ version 12.1.0 built from msys2 on my system path. m2w64-toolchain ends up getting installed along with everything, whether or not I ask for it. Asking conda to remove it removes everything related to pymc and aesara, so it seems to be a requirement somewhere. I pointed aesara to the msys2 g++ with
So it's still pointing to the mingw32 installation version 5.3.0 associated with the conda environment rather than the newer msys2 version. I am also getting some new warnings pop up when I import aesara:
These issues don't seem to affect my ability to sample models, but they are also new and exciting. |
@jessegrabowski Can you try with a new environment and instead:
|
@jessegrabowski I also changed the fancy installation instructions, they should work again ( |
Output of check_blas:
Looks like it works. I still got the "could not locate" warnings as aesara was imported in the test script. Not sure if that's a problem on my end, though; it's new since I did this msys2 stuff. Will try a fancy-install with |
|
@twiecki got it. I will test accordingly and confirm. @jessegrabowski I will share details of my Windows 10 install |
I believe Aesara's dependency list may be the reason that
Note the inclusion of |
Yes, we could do the same trick with base there too.
…On Mon, Jun 6, 2022, 17:04 Jed Ludlow ***@***.***> wrote:
I believe Aesara's dependency list may be the reason that m2w64-toolchain
is getting installed even when asking for pymc-base under the Fancy
Install instructions. Here's the output of conda search aesara=2.6.6
--info:
aesara 2.6.6 py39h7fcc1c2_0
---------------------------
file name : aesara-2.6.6-py39h7fcc1c2_0.tar.bz2
name : aesara
version : 2.6.6
build : py39h7fcc1c2_0
build number: 0
size : 1.9 MB
license : BSD-3-Clause
subdir : win-64
url : https://conda.anaconda.org/conda-forge/win-64/aesara-2.6.6-py39h7fcc1c2_0.tar.bz2
md5 : a90f08442ce38874f568b5a0fad63ec0
timestamp : 2022-05-10 02:05:04 UTC
dependencies:
- cons
- etuples
- filelock
- libblas >=3.8.0,<4.0a0
- liblapack >=3.8.0,<4.0a0
- libpython >=2.0
- logical-unification
- m2w64-toolchain_win-64
- minikanren
- numpy >=1.9.1
- python >=3.9,<3.10.0a0
- python_abi 3.9.* *_cp39
- scipy >=0.14,<1.8.0
- setuptools
- six >=1.9.0
- typing_extensions
Note the inclusion of m2w64-toolchain_win-64 in the list.
—
Reply to this email directly, view it on GitHub
<#4937 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFETGBQIS5PR3U26TF762LVNYHQDANCNFSM5CJBRBYA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@twiecki installing pymc from conda-forge works fine for me on Win11 |
@twiecki, installing pymc from conda-forge using the Simple Install instructions works fine for me on Windows 10, and I can verify that MKL was automatically discovered by Aesara to link against. |
Thanks everyone! I think we can close this then. |
Hi @michaelosthege - here is the first version of the Installation Reference. Let me know what changes may be needed.
For Pymc3 Windows users who may not have a programming background or have comfort with tool chains and such, the installation instructions on this page (https://github.com/pymc-devs/pymc3/wiki/Installation-Guide-(Windows)) may not be sufficient. The instructions posted below go beyond the basic installation process posted at the above link.
In addition, there are a large community of users, who use both R and Python (Anaconda). The
RTools mingw tool chain
has to be first on the System Environment variables so thatR packages that need compilation such as rstan, brms
will run correctly. In this situation, the compilation ofpymc3
models will break and additional post-installUser Environment Variables
has to be done sopymc3
works correctly.Versions and main components
theano-pymc
)m2w64 tool chain from conda-forge
RTools mingw tool chain
on the System PATHThe essence of a solid PyMC3 installation on Windows is to install most of the dependencies through conda. The reason installation via PyPI is difficult is that Theano/Aesara require compilation against MKL, which is difficult to set up, while Conda comes with its own compilers and MKL installation.
⚠ Do not pip install without first installing dependencies with conda. ⚠
Method 1: Run
conda env create -f environment.yml
to create a fresh environment in one step - use Notepad++, if possible to create the saidenvironment.yml
file.environment.yml (copy from
name: pm3env
and ending withpymc3
and save it inC:\Users\Your_User_Name
)You can change name to something meaningful for you such as
pym3
orenv_pym3
. You do not have to usepm3env
. Keep it simple and meaningful so you can use the environment with ease when using the command line.Method 2: You can create
pymc3
specific environment also directly from theAnaconda3 Command Prompt
using the following command:conda create -n pm3env -c conda-forge "python=3.8" libpython mkl-service m2w64-toolchain numba python-graphviz scipy
After you have created the environment, you can test it has been created successfully by typing:
conda info --envs
- the output of the command will show all the environments that exist in the current Anaconda3 install. Hopefully you will see your environment forpymc3
Activate your environment by typing the command:
conda activate pm3env
(or whatever name you chose)Your command prompt will look like:
(pm3env) C:\Users\Your_User_Name
Check Packages Installed using the command
conda list
and all packages installed inpm3env
will be shown. Check if either one oftheano
ortheano-pymc
has been installed. Make note of it (It should not be)Install Pymc3: Now you can install Pymc3 using the command:
pip install pymc3
and then if all requirements are met, all packages from pip and their dependencies will be installed,. Of critical importance to note is whethertheano-pymc
has been installed along withpymc3
- pymc3 will not run without this - Heretheano-pymc
should be installed. In addition, in thepip
output check that dependencies such asarviz
(for working withpymc3
objects) andmatplotlib
(for general purpose data graphing) have also been installed.Sometimes these packages may not be installed in your new environment but will be installed likely in the location below on Windows 10:
c:\users\your_user_name\appdata\roaming\python\python38\site-packages
- note the number 38 next topython38
in the folder name. This means that versions relevant for python3.8 have been installed here. These packages will not appear in the output ofconda list
. Ensure that thepython
you specified (python=3.8) matches what you see in the folder name here (python38)[@michaelosthege The original instructions ask to install
theano-pymc
usingconda-forge
. However, I found that in the new dependency installation ofpymc3
,theano-pymc
is being automatically being installed and it is working correctly. This is one where I need your input on whether we remove the note to updatetheano-pymc
. I think this is outdated]Now there are additional ways to install ``pymc3
and additional variants of
pymc3```. Refer to the next section, which may be more appropriate for advanced users.Developer Installation
If you want to tinker with PyMC3 itself, first clone the repository and then make an "editable" installation:
(You need to have already installed
git
for this to work, if not installgit
first)Upgrading from Theano to Theano-PyMC - Just in case when you run
conda list
at thepm3env
prompt and find that you havetheano
instead oftheano-pymc
(stranger things have and will happen!)theano
was installed from: it will show pypi or conda-forge.pip uninstall theano
- you should see a message statingtheano
has been uninstalledconda remove theano
- you should answer with a y if prompted for the removal oftheano
theano-pymc
using the command,conda install -c conda-forge theano-pymc
.conda list
and verifypymc3 & theano-pymc
are installed.Optional Dependencies (before you install any packages, first check they have not been already installed using
conda list
conda install -c conda-forge python-graphviz
andpip install pydot-ng
Jupyter Notebook
orJupyter Lab
are not installed. If you are working with Anaconda3, you install these two Jupyter tools from Anaconda3 Navigator or from thepm3env command prompt
using the command:conda install -c conda-forge notebook
Do Not Close the Command Prompt window of the pm3env - we have to use it later on.
Post Installation Checks - Do Not Skip This Step on Windows
A. Assumes you have installed Jupyter Notebook
B. Make note of whether you have R and in particular RTools installed on your laptop and location of its' install.
C. Assumes you have either Admin or Power-User rights on your laptop so that you can make changes to the environment variables at the User level.
Windows does not come pre-installed with C and C++ compilers (as Mac and Linux Distros do) so it is important to ensure your Anaconda3 environments are pointing to the correct internal compilers.
Going back to the original creation / installation of
pm3env
environment, one of the packages installed ism2w64-toolchain
. Here things can get complex in terms of having compiler tools specific to the version of Python and to that of the environment. So generally speaking, try to keep your Anaconda3 environments to a minimum, when you are starting out with tools such aspymc3
. Also make sure you install am2w64-toolchain
in each environment you create. Conda will ensure that you have the most appropriate version of the compilers for the version of Python in that environment. There are exceptions, but it gets beyond the scope of this document.On Windows, search for "Edit System Environment Variables". You will be taken to the screen below
Click on the "Environment Variables" on the bottom right-hand corner and you will see a new window pop-up with the top Window for User variables and the bottom window for the System variables. Click on the entry labeled Path under User Variables for Your_User_Name and click edit. Here you should add the following Anaconda paths specific to your environment:
Note the location of where Anaconda3 is installed by default (as shown below). If you have changed the location during the installation of Anaconda3, please make the changes accordingly.
First:
C:\ProgramData\Anaconda3\Library\mingw-w64\bin
Second:
C:\ProgramData\Anaconda3\Library\bin
Third:
C:\ProgramData\Anaconda3\Scripts
Move each of the entries so that they appear in the exact order as shown above at the top of the User Variables Path using the Move Up and Move Down buttons
Then click "OK" to accept the changes all the way.
Go back to the
pm3env
Command Prompt window that is already open that displays(pm3env) C:\Users\Your_User_Name>
Type
jupyter-notebook
at the prompt and (hopefully) a page should be opened in your Default Browser.On the top right corner, click on the drop-down under New
Select Python 3 (ipykernel)
You should see a new Jupyter Notebook open that looks as follows:
Make sure that at the top right corner, the button says Trusted. If this is the first time you are using a Jupyter Notebook, it might show up as Not Trusted. Click on it if it says "Not Trusted" and select the option to make it "Trusted".
In the first Notebook cell, type
import theano as tp
and click on the Run button.You may see a warning as shown in the picture below (
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
)In the next cell type the following commands and click Run
import pymc3 as pm
print(f"Running on PyMC3 v{pm.__version__}")
You should see an output as follows:
Running on PyMC3 v3.11.2
You can now begin testing the full capabilities of Pymc3 by starting with the three examples from the Getting Started with Pymc3 - linked here - http://docs.pymc.io/notebooks/getting_started
Good luck with using Pymc3!
The text was updated successfully, but these errors were encountered: