Page 1 of 1

can't compile, "no module named yaml"

PostPosted: Saturday, 16th November 2019, 16:17
by HexaDoken
Hello! I'm trying to build crawl on windows 7, following step-by-step the instructions from "Building on Windows (MSYS2)" section in the INSTALL.txt. However, when doing Make, I get "No module named 'yaml'". I did install yaml as per instructions before; running "pip install pyyaml" returns "Requirement already satisfied: pyyaml in d/msys64/mingw64/lib/python3.8/site-packages (5.1.2)". But trying to verify installation by "python -m yaml" tells me "no module named yaml", same as when making.

What am I doing wrong?

Re: can't compile, "no module named yaml"

PostPosted: Saturday, 16th November 2019, 19:13
by advil
Are you sure that the version of pip you are calling matches the version of python that is first in the path? Often a situation like this happens when e.g. `python` is calling python 2, but `pip` (as the message indicates) is calling python 3, or vice versa. The INSTALL.txt instructions are written on the assumption that only (one version of) python 3 is installed.

Re: can't compile, "no module named yaml"

PostPosted: Sunday, 17th November 2019, 11:24
by HexaDoken
...Despite following instructions to the letter, there are apparently two version of python: python and python3 are 3.7.4, and python3.8 is 3.8.0. The latter one seems to see yaml installed.

How do I get crawl to compile with python 3.8?

Re: can't compile, "no module named yaml"

PostPosted: Sunday, 17th November 2019, 14:58
by advil
It looks like msys2 very recently updated the `python3`-labeled packages to be 3.8; not sure where the 3.7 version was coming from but if you didn't just install msys2 for these purposes, it might have been lingering. (Or it might even be the current default python version on new MSYS2 versions, which would be confusing.) I would start by trying to explicitly install/reinstall the package `mingw-w64-x86_64-python3`, which is python 3.8, and should explicitly install `python.exe` in the right place. I'm not sure if msys2 has a way of switching between different versions of something like python (many package managers do), so you may need to do that. You might also try uninstalling 3.7?

Re: can't compile, "no module named yaml"

PostPosted: Monday, 18th November 2019, 16:02
by HexaDoken
I did indeed install msys2 just for the purpose of building crawl, and it does indeed seem that the default python version is still 3.7, since reinstalling python package did nothing. Lacking experience in operating this, I wasn't particularly successful in getting it to use 3.8...

...so after some time I decided to just manually install yaml into python 3.7, which proved to be significantly easier.