How to install python-crfsuite on windows

2.7k Views Asked by At

I'm trying to install scrapy on win7. One dependency is python-crfsuite. When I run :

pip install python-crfsuite==0.8.4

It fails repeatedly finally giving:

copying pycrfsuite\__init__.py -> build\lib.win32-2.7\pycrfsuite
running build_ext
building 'pycrfsuite._pycrfsuite' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

Are there any precompiled binary files for win32 for this package?

2

There are 2 best solutions below

0
On

If you already have a version of Microsoft Visual Studio installed with Common tools. All you need to do is run this command.

set VS90COMNTOOLS=%VS140COMNTOOLS%

Assuming you have Visual Studio 14 installed currently.

0
On

Adding this answer to help people who are still trying to install python-crfsuite years later.

I was getting an error message about needing to install Microsoft Visual C++ 14.0 when asking pip to install python-crfsuite on Python 3.8, Windows 10. It kept saying Microsoft Visual C++ is needed to create the wheel.

What finally worked for me was to install python-crfsuite on Python 3.7.4.

I suspect it worked because the python-crfsuite wheel on PyPI was not available for Python 3.8, but it was available for Python 3.7. You can the check the package's PyPI page to see which wheels are available https://pypi.org/project/python-crfsuite/#files

Also, if

pip install python-crfsuite

is not working for you, try downloading the wheel and get pip to install it instead.