Installation of G++

Dear colleagues,

When I use “import pymc3 as pm” and run a code I receive this warning:

WARNING (theano.configdefaults): g++ not available, if using conda: conda install m2w64-toolchain

Could you please let me know where I can find and install G++?
Is there any tip or trick for installing G++?

Your reply is highly appreciated.

Yours sincerely,

1 Like

Did you install pymc as describe in the Installation section of this page (edit: this is the version 3 link, see below)?

[Edit:] Current installation instructions can be found here.

2 Likes

Thank you for your reply.

No! I am using PyCharm and I simply used “Python Packages” in PyCharm to install “pymc3”.
Do you recommend to move on step by step to install “pymc3” based on the page you shared?

1 Like

Given the somewhat involved dependencies (all that stuff that makes pymc go fast), it is strongly recommended that you install pymc and its required packages using those instructions. There are also several annoying platform-specific installation issues that those instructions take care of.

3 Likes

Many thanks for your reply and the recommendation.

2 Likes

@Majid-Eskafi I’m wondering if your problem is solved, or is there anything else we can help you with?

1 Like

@almostmeenal thank you for asking.
Yes, I installed pmc3 from the link that @cluhmann suggested and I do not receive the same warning. However, now I am receiving this warning and I would appreciate your reply if you let me know how I can fix it:

WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

@Majid-Eskafi this warning is telling you that a necessary library that will speed up theano processing is missing and hence it is going to use Numpy C-API based BLAS functions.

BLAS (Basic Linear Algebra Subprograms) is a critical foundational library for a lot of math related operations (particularly Vector and Matrix operations).

In your environment set up for pymc3 can share the output of the command: conda list?

In the list can you confirm you have libblas, libcblas, liblapack, mkl, mkl-service installed?

At the same prompt, can you run g++ --version and share the version of the compiler you are using?

I have seen this warning come up when using older versions of gcc compilers. For me on Windows and Linux, installing the gcc version 11.2.0 helped.

Note, by default, based on the installation (if you are using Windows), gcc-5.3.0 compilers are installed. You are better off upgrading to the version above I mentioned. The latest MSYS2 gcc suite has the 11.2.0 version available. You cannot get that from any channel on Conda, including Conda-Forge

4 Likes

Here is a tested solution that eliminates the blas warning message. This solution was posted by “@KTada777” in this thread linked below:

Windows 10, Pymc3, GCC Compilers, Blas Warnings

At this point, I created the
.theanorc
file with the following 2 lines

[blas]
ldflags = -lblas

and put it the directly just under the username (like "owner".) Then, the following warning was disappeared.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

If you are a Windows user, use Notepad++ to create the .theanorc file - Note there is a . (period) before “theanorc” file name.

Save the .theanorc file under C:\Users\Your_User_Name\

1 Like

here is the conda list:

Name Version Build Channel

argon2-cffi 20.1.0 py38h2bbff1b_1
arviz 0.11.4 pypi_0 pypi
async_generator 1.10 pyhd3eb1b0_0
attrs 21.2.0 pyhd3eb1b0_0
backcall 0.2.0 pyhd3eb1b0_0
blas 1.0 mkl
bleach 4.1.0 pyhd3eb1b0_0
bottleneck 1.3.2 py38h2a96729_1
brotli 1.0.9 ha925a31_2
ca-certificates 2021.10.26 haa95532_2
cachetools 5.0.0 pypi_0 pypi
certifi 2021.10.8 py38haa95532_0
cffi 1.15.0 py38h2bbff1b_0
cftime 1.5.1.1 py38h080aedc_0
colorama 0.4.4 pyhd3eb1b0_0
curl 7.80.0 h2bbff1b_0
cycler 0.11.0 pyhd3eb1b0_0
debugpy 1.5.1 py38hd77b12b_0
decorator 5.1.0 pyhd3eb1b0_0
defusedxml 0.7.1 pyhd3eb1b0_0
dill 0.3.4 pyhd3eb1b0_0
entrypoints 0.3 py38_0
fastprogress 1.0.0 pyhb85f177_0
filelock 3.4.0 pyhd3eb1b0_0
fonttools 4.28.5 pypi_0 pypi
freetype 2.10.4 hd328e21_0
hdf4 4.2.13 h712560f_2
hdf5 1.10.6 h7ebc959_0
icc_rt 2019.0.0 h0cc432a_1
icu 58.2 ha925a31_3
importlib-metadata 4.8.2 py38haa95532_0
importlib_metadata 4.8.2 hd3eb1b0_0
intel-openmp 2021.4.0 haa95532_3556
ipykernel 6.4.1 py38haa95532_1
ipython 7.29.0 py38hd4e2768_0
ipython_genutils 0.2.0 pyhd3eb1b0_1
ipywidgets 7.6.5 pyhd3eb1b0_1
jedi 0.18.0 py38haa95532_1
jinja2 3.0.2 pyhd3eb1b0_0
jpeg 9d h2bbff1b_0
jsonschema 3.2.0 pyhd3eb1b0_2
jupyter 1.0.0 py38_7
jupyter_client 7.1.0 pyhd3eb1b0_0
jupyter_console 6.4.0 pyhd3eb1b0_0
jupyter_core 4.9.1 py38haa95532_0
jupyterlab_pygments 0.1.2 py_0
jupyterlab_widgets 1.0.0 pyhd3eb1b0_1
kiwisolver 1.3.2 pypi_0 pypi
libcurl 7.80.0 h86230a5_0
libgpuarray 0.7.6 hfa6e2cd_0
libnetcdf 4.6.1 hf59b723_4
libpng 1.6.37 h2a8f88b_0
libpython 2.1 py38_0
libssh2 1.9.0 h7a1dbc1_1
libtiff 4.2.0 hd0e1b90_0
libwebp 1.2.0 h2bbff1b_0
lz4-c 1.9.3 h2bbff1b_1
m2w64-binutils 2.25.1 5
m2w64-bzip2 1.0.6 6
m2w64-crt-git 5.0.0.4636.2595836 2
m2w64-gcc 5.3.0 6
m2w64-gcc-ada 5.3.0 6
m2w64-gcc-fortran 5.3.0 6
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gcc-objc 5.3.0 6
m2w64-gmp 6.1.0 2 conda-forge
m2w64-headers-git 5.0.0.4636.c0ad18a 2
m2w64-isl 0.16.1 2
m2w64-libiconv 1.14 6
m2w64-libmangle-git 5.0.0.4509.2e5a9a2 2
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
m2w64-make 4.1.2351.a80a8b8 2
m2w64-mpc 1.0.3 3
m2w64-mpfr 3.1.4 4
m2w64-pkg-config 0.29.1 2
m2w64-toolchain 5.3.0 7
m2w64-tools-git 5.0.0.4592.90b8472 2
m2w64-windows-default-manifest 6.4 3
m2w64-winpthreads-git 5.0.0.4634.697f757 2
m2w64-zlib 1.2.8 10
mako 1.1.4 pyhd3eb1b0_0
markupsafe 2.0.1 py38h2bbff1b_0
matplotlib 3.5.1 pypi_0 pypi
matplotlib-base 3.5.0 py38h6214cd6_0
matplotlib-inline 0.1.2 pyhd3eb1b0_2
mistune 0.8.4 py38he774522_1000
mkl 2021.4.0 h0e2418a_729 conda-forge
mkl-service 2.4.0 py38h2bbff1b_0
mkl_fft 1.3.1 py38h277e83a_0
mkl_random 1.2.2 py38hf11a4ad_0
msys2-conda-epoch 20160418 1 conda-forge
munkres 1.1.4 py_0
nbclient 0.5.3 pyhd3eb1b0_0
nbconvert 6.1.0 py38haa95532_0
nbformat 5.1.3 pyhd3eb1b0_0
nest-asyncio 1.5.1 pyhd3eb1b0_0
netcdf4 1.5.8 pypi_0 pypi
notebook 6.4.6 py38haa95532_0
numexpr 2.8.1 py38hb80d3ca_0
numpy 1.21.2 py38hfca59bb_0
numpy-base 1.21.2 py38h0829f74_0
olefile 0.46 pyhd3eb1b0_0
openssl 1.1.1l h2bbff1b_0
packaging 21.3 pyhd3eb1b0_0
pandas 1.3.5 py38h6214cd6_0
pandocfilters 1.4.3 py38haa95532_1
parso 0.8.3 pyhd3eb1b0_0
patsy 0.5.2 pypi_0 pypi
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 9.0.0 pypi_0 pypi
pip 21.2.2 py38haa95532_0
prometheus_client 0.12.0 pyhd3eb1b0_0
prompt-toolkit 3.0.20 pyhd3eb1b0_0
prompt_toolkit 3.0.20 hd3eb1b0_0
pycparser 2.21 pyhd3eb1b0_0
pygments 2.10.0 pyhd3eb1b0_0
pygpu 0.7.6 py38h2a96729_0
pymc3 3.11.4 py38hd4e2768_0
pyparsing 3.0.6 pypi_0 pypi
pyqt 5.9.2 py38ha925a31_4
pyrsistent 0.18.0 py38h196d8e1_0
python 3.8.12 h6244533_0
python-dateutil 2.8.2 pyhd3eb1b0_0
python_abi 3.8 2_cp38 conda-forge
pytz 2021.3 pypi_0 pypi
pywin32 302 py38h827c3e9_1
pywinpty 0.5.7 py38_0
pyzmq 22.3.0 py38hd77b12b_2
qt 5.9.7 vc14h73c81de_0
qtconsole 5.1.1 pyhd3eb1b0_0
qtpy 1.10.0 pyhd3eb1b0_0
scipy 1.7.3 py38h0a974cb_0
seaborn 0.11.2 pyhd3eb1b0_0
semver 2.13.0 pyhd3eb1b0_0
send2trash 1.8.0 pyhd3eb1b0_1
setuptools 58.0.4 py38haa95532_0
sip 4.19.13 py38ha925a31_0
six 1.16.0 pyhd3eb1b0_0
sqlite 3.37.0 h2bbff1b_0
tbb 2021.4.0 h59b6b97_0
terminado 0.9.4 py38haa95532_0
testpath 0.5.0 pyhd3eb1b0_0
theano 1.0.4 py38_0
theano-pymc 1.1.2 py38h885f38d_0 conda-forge
tk 8.6.11 h2bbff1b_0
tornado 6.1 py38h2bbff1b_0
traitlets 5.1.1 pyhd3eb1b0_0
typing-extensions 3.10.0.2 hd3eb1b0_0
typing_extensions 3.10.0.2 pyh06a4308_0
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
vs2017_win-64 19.16.27032.1 hb4161e2_3
vswhere 2.8.4 haa95532_0
wcwidth 0.2.5 pyhd3eb1b0_0
webencodings 0.5.1 py38_1
wheel 0.37.1 pyhd3eb1b0_0
widgetsnbextension 3.5.1 py38_0
wincertstore 0.2 py38haa95532_2
winpty 0.4.3 4
xarray 0.20.2 pypi_0 pypi
xz 5.2.5 h62dcd97_0
zipp 3.7.0 pyhd3eb1b0_0
zlib 1.2.11 h8cc25b3_4
zstd 1.4.9 h19a0ad4_0

@sree_datta thank you. It worked.

I see every time a problem is solved, but still, I can not run my model. Now I do not have the same error as before. However, I receive this warning:

Problem occurred during compilation with the command line below:
“C:\ProgramData\chocolatey\bin\g++.exe”

Any reply to solve this problem is highly appreciated.

@Majid-Eskafi Could you post the full error message? I’m making a guess that during compilation phase, the program cannot find the g++.exe - this is a guess; If you post the full error message I can trouble shoot better.

Can you also check if g++.exe is on path? What is the output when you run g++ --version at the command prompt?

It appears you have both m2w64 tool chain which uses version 5.3.0 and the tool chain installed via choclatey. Can you post your User PATH variable values and System PATH variable values from your Environment Variables?

1 Like

@sree_datta I appreciate your consideration for replying to my questions.
I followed the instructions you mentioned step by step.

Now, in the output of the command: “conda list” I can see:

Name Version Build Channel

arviz 0.11.4 pypi_0 pypi
ca-certificates 2021.10.8 h5b45459_0 conda-forge
cachetools 5.0.0 pypi_0 pypi
cairo 1.16.0 h15b3021_1009 conda-forge
cftime 1.5.2 pypi_0 pypi
cycler 0.11.0 pypi_0 pypi
dill 0.3.4 pypi_0 pypi
expat 2.4.4 h39d44d4_0 conda-forge
fastprogress 1.0.0 pypi_0 pypi
filelock 3.4.2 pypi_0 pypi
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.13.96 h1989441_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.29.1 pypi_0 pypi
freetype 2.10.4 h546665d_1 conda-forge
fribidi 1.0.10 h8d14728_0 conda-forge
getopt-win32 0.1 h8ffe710_0 conda-forge
gettext 0.19.8.1 ha2e2712_1008 conda-forge
graphite2 1.3.13 1000 conda-forge
graphviz 2.50.0 had6c3a3_2 conda-forge
gts 0.7.6 h7c369d9_2 conda-forge
harfbuzz 3.3.1 hc1763ed_0 conda-forge
icu 69.1 h0e60522_0 conda-forge
intel-openmp 2022.0.0 h57928b3_3663 conda-forge
jbig 2.1 h8d14728_2003 conda-forge
jpeg 9e h8ffe710_0 conda-forge
kiwisolver 1.3.2 pypi_0 pypi
lerc 3.0 h0e60522_0 conda-forge
libblas 3.9.0 12_win64_mkl conda-forge
libcblas 3.9.0 12_win64_mkl conda-forge
libdeflate 1.8 h8ffe710_0 conda-forge
libffi 3.4.2 h8ffe710_5 conda-forge
libgd 2.3.3 h217ff3b_1 conda-forge
libglib 2.70.2 h3be07f2_2 conda-forge
libiconv 1.16 he774522_0 conda-forge
liblapack 3.9.0 12_win64_mkl conda-forge
libpng 1.6.37 h1d00b33_2 conda-forge
libpython 2.1 py38haa244fe_1 conda-forge
libtiff 4.3.0 hd413186_2 conda-forge
libwebp 1.2.2 h57928b3_0 conda-forge
libwebp-base 1.2.2 h8ffe710_1 conda-forge
libxcb 1.13 hcd874cb_1004 conda-forge
libxml2 2.9.12 hf5bbc77_1 conda-forge
libzlib 1.2.11 h8ffe710_1013 conda-forge
llvmlite 0.38.0 py38h57a6900_0 conda-forge
lz4-c 1.9.3 h8ffe710_1 conda-forge
m2w64-binutils 2.25.1 5 conda-forge
m2w64-bzip2 1.0.6 6 conda-forge
m2w64-crt-git 5.0.0.4636.2595836 2 conda-forge
m2w64-gcc 5.3.0 6 conda-forge
m2w64-gcc-ada 5.3.0 6 conda-forge
m2w64-gcc-fortran 5.3.0 6 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gcc-objc 5.3.0 6 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-headers-git 5.0.0.4636.c0ad18a 2 conda-forge
m2w64-isl 0.16.1 2 conda-forge
m2w64-libiconv 1.14 6 conda-forge
m2w64-libmangle-git 5.0.0.4509.2e5a9a2 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
m2w64-make 4.1.2351.a80a8b8 2 conda-forge
m2w64-mpc 1.0.3 3 conda-forge
m2w64-mpfr 3.1.4 4 conda-forge
m2w64-pkg-config 0.29.1 2 conda-forge
m2w64-toolchain 5.3.0 7 conda-forge
m2w64-tools-git 5.0.0.4592.90b8472 2 conda-forge
m2w64-windows-default-manifest 6.4 3 conda-forge
m2w64-winpthreads-git 5.0.0.4634.697f757 2 conda-forge
m2w64-zlib 1.2.8 10 conda-forge
matplotlib 3.5.1 pypi_0 pypi
mkl 2021.4.0 h0e2418a_729 conda-forge
mkl-service 2.4.0 py38h4f8af0f_0 conda-forge
msys2-conda-epoch 20160418 1 conda-forge
netcdf4 1.5.8 pypi_0 pypi
numba 0.55.1 py38h5858985_0 conda-forge
numpy 1.21.5 py38hcf66579_0 conda-forge
openssl 3.0.0 h8ffe710_2 conda-forge
packaging 21.3 pypi_0 pypi
pandas 1.4.0 pypi_0 pypi
pango 1.50.3 h6a11761_0 conda-forge
patsy 0.5.2 pypi_0 pypi
pcre 8.45 h0e60522_0 conda-forge
pillow 9.0.1 pypi_0 pypi
pip 22.0.3 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 h8ffe710_0 conda-forge
pthread-stubs 0.4 hcd874cb_1001 conda-forge
pymc3 3.11.4 pypi_0 pypi
pyparsing 3.0.7 pypi_0 pypi
python 3.8.12 h900ac77_2_cpython conda-forge
python-dateutil 2.8.2 pypi_0 pypi
python-graphviz 0.19.1 pyhaef67bd_0 conda-forge
python_abi 3.8 2_cp38 conda-forge
pytz 2021.3 pypi_0 pypi
scipy 1.8.0 py38ha1292f7_1 conda-forge
semver 2.13.0 pypi_0 pypi
setuptools 60.8.1 py38haa244fe_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sqlite 3.37.0 h8ffe710_0 conda-forge
tbb 2021.5.0 h2d74725_0 conda-forge
theano-pymc 1.1.2 pypi_0 pypi
typing-extensions 3.10.0.2 pypi_0 pypi
ucrt 10.0.20348.0 h57928b3_0 conda-forge
vc 14.2 hb210afc_6 conda-forge
vs2015_runtime 14.29.30037 h902a5da_6 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
xarray 0.21.1 pypi_0 pypi
xorg-kbproto 1.0.7 hcd874cb_1002 conda-forge
xorg-libice 1.0.10 hcd874cb_0 conda-forge
xorg-libsm 1.2.3 hcd874cb_1000 conda-forge
xorg-libx11 1.7.2 hcd874cb_0 conda-forge
xorg-libxau 1.0.9 hcd874cb_0 conda-forge
xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge
xorg-libxext 1.3.4 hcd874cb_1 conda-forge
xorg-libxpm 3.5.13 hcd874cb_0 conda-forge
xorg-libxt 1.2.1 hcd874cb_2 conda-forge
xorg-xextproto 7.3.0 hcd874cb_1002 conda-forge
xorg-xproto 7.0.31 hcd874cb_1007 conda-forge
xz 5.2.5 h62dcd97_1 conda-forge
zlib 1.2.11 h8ffe710_1013 conda-forge
zstd 1.5.2 h6255e5f_0 conda-forge

when I run “g++ --version” I see:

g++ (Rev5, Built by MSYS2 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

How can I upgrade it to the “gcc version 11.2.0”? any command?

User PATH:
C:\Users\m_esk\anaconda3\Library\mingw-w64\bin

System PATH:
C:\Python39\Scripts\

I also followed this Installation Guide

However, I see I have more errors and warnings:
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifl
Could not locate executable f90
Could not locate executable DF
Could not locate executable efl

Thread model: posix
gcc version 5.3.0 (Rev5, Built by MSYS2 project)
WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
Problem occurred during compilation with the command line below:
“C:\Users\m_esk\anaconda3\envs\pm3env\Library\mingw-w64\bin\g++.exe”

I think I am mixing up everything @sree_datta.

@Majid-Eskafi you need not upgrade to gcc 11.2.0. In one of the links I posted about setting up the ``libblassettings using the.theanorc.``` file (see my post in the above chain).

Let us meet as you suggested via Zoom. If I take you through the steps you should be good.

Sree

1 Like

I could find the solution and successfully install and run Pymc3 using these detailed instructions by @sree_datta.

2 Likes

Thanks for the feedback on the instructions @Majid-Eskafi - happy to know you can work with Pymc3 now

1 Like