[Solved] Pygments not working on Windows using MSYS2

I use MSYS2 for a bash shell environment in windows. Hugo works fine in this environment and does a good job. But it can’t find Pygments installed in Python with pip in MSYS2. As can be seen from the listing below, hugo and pygmentize are in /usr/bin and on the path, but it says: WARN 2017/08/20 18:28:14 Highlighting requires Pygments to be installed and in the path. It all works fine in Linux, but not in MSYS2 bash. Is hugo trying to be clever with the windows path or am I missing something?

Edit: Having looked at the sources for HasPygments(), it looks like a problem with exec.LookPath() in Go.

Bill@Cynthia MINGW64 /d/Hugo/blog
$ hugo version
Hugo Static Site Generator v0.26 windows/amd64 BuildDate: 2017-08-17T13:16:29+01:00

Bill@Cynthia MINGW64 /d/Hugo/blog
$ hugo -v
INFO 2017/08/20 18:28:14 Using config file:
INFO 2017/08/20 18:28:14 using a UnionFS for static directory comprised of:
INFO 2017/08/20 18:28:14 Base: D:\Hugo\blog\themes\theme-hugo-foundation6\static
INFO 2017/08/20 18:28:14 Overlay: D:\Hugo\blog\static\
INFO 2017/08/20 18:28:14 syncing static files to d:\billthefarmer.github.io\blog\
Started building sites ...
WARN 2017/08/20 18:28:14 Highlighting requires Pygments to be installed and in the path
WARN 2017/08/20 18:28:14 Highlighting requires Pygments to be installed and in the path
INFO 2017/08/20 18:28:14 found taxonomies: map[string]string{"category":"categories"}
WARN 2017/08/20 18:28:14 [en] Unable to locate layout for "taxonomyTerm": [taxonomy/category.terms.en.html.html taxonomy/category.terms.html.html taxonomy/category.terms.en.html taxonomy/category.terms.html _default/terms.en.html.html _default/terms.html.html _default/terms.en.html _default/terms.html indexes/indexes.en.html.html indexes/indexes.html.html indexes/indexes.en.html indexes/indexes.html theme/taxonomy/category.terms.en.html.html theme/taxonomy/category.terms.html.html theme/taxonomy/category.terms.en.html theme/taxonomy/category.terms.html theme/_default/terms.en.html.html theme/_default/terms.html.html theme/_default/terms.en.html theme/_default/terms.html theme/indexes/indexes.en.html.html theme/indexes/indexes.html.html theme/indexes/indexes.en.html theme/indexes/indexes.html]
INFO 2017/08/20 18:28:14 Alias "\categories\diy\page\1\index.html" translated to "categories\diy\page\1\index.html"
INFO 2017/08/20 18:28:14 Alias "\page\1\index.html" translated to "page\1\index.html"
INFO 2017/08/20 18:28:14 Alias "\categories\hacking\page\1\index.html" translated to "categories\hacking\page\1\index.html"
INFO 2017/08/20 18:28:14 Alias "\post\page\1\index.html" translated to "post\page\1\index.html"
INFO 2017/08/20 18:28:14 Alias "\categories\recipes\page\1\index.html" translated to "categories\recipes\page\1\index.html"
Built site for language en:
0 draft content
0 future content
0 expired content
55 regular pages created
12 other pages created
0 non-page files copied
33 paginator pages created
3 categories created
total in 183 ms

Bill@Cynthia MINGW64 /d/Hugo/blog
$  python --version
Python 2.7.13

Bill@Cynthia MINGW64 /d/Hugo/blog
$ pip list --format=columns
Package         Version
--------------- -------
appdirs         1.4.3
beautifulsoup4  4.2.0
html2text       3.200.3
html5lib        1.0b1
packaging       16.8
pip             9.0.1
Pygments        2.2.0
pyparsing       2.2.0
python-dateutil 2.6.1
pytoml          0.1.14
PyYAML          3.10
remarshal       0.7.0
scons           2.5.1
setuptools      35.0.2
six             1.10.0

Bill@Cynthia MINGW64 /d/Hugo/blog
$ which pygmentize
/usr/bin/pygmentize

Bill@Cynthia MINGW64 /d/Hugo/blog
$ which hugo
/usr/bin/hugo

Bill@Cynthia MINGW64 /d/Hugo/blog
$ whereis pygmentize
pygmentize: /usr/bin/pygmentize

Bill@Cynthia MINGW64 /d/Hugo/blog
$ whereis hugo
hugo: /usr/bin/hugo.exe

Bill@Cynthia MINGW64 /d/Hugo/blog
$ echo $PATH
/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Bill@Cynthia MINGW64 /d/Hugo/blog
$

The solution is to install real windows python and install Pygments there. Ho Hum :sunglasses: