Recipe: Building PyStemmer on Windows – fixed!

So I tried to build pyStemmer 1.1.0 for Python 2.7 on Windows and it did not work out of the box. On closer examination I found out that pyStemmer’s setup.py is flawed on line 24:

...
and os.path.split(line.strip())[0] in library_core_dirs]
...

did not find all necessary c files for the language stemmers. This is due to os.path.split not being able to strip the “\” at the end of each entry in mkinc_utf8.mak. This can be fixed easily by changing this line to the following:

...
and os.path.split(line.split()[0].strip())[0] in library_core_dirs]
...

HTH.

4 Responses to “Recipe: Building PyStemmer on Windows – fixed!”

  1. Thanks, it helped me. I too faced the same issue

  2. Thanks Phill, this saved me from having to go into the code and finding the problem. As an update to our post here I would like to add: I found the problem to still occurr with Python 2.7 and PyStemmer 1.2.0 You solution corrects the problem in this case also

  3. […] quick Google search gives me this site: http://pcscholl.de/2011/01/26/recipe-building-pystemmer-on-windows-fixed/ which tells me to replace line 24 in setup.py with a new line of code‚ but even that […]

  4. […] fast Google search gives me this website: http://pcscholl.de/2011/01/26/formula-creating-pystemmer-on-windows-set/ which shows me to displace line 24 in setup.py using a fresh line of signal, but actually that does […]

Discussion Area - Leave a Comment