0

I am attempting to install python library Pyahorcorasick on a windows machine.

The documentation indicates to run python setup.py install. I assume this is after downloading and extracing the .tar file. Upon cd to the proper directory and running the setup file I get a error: Unable to find vcvarsall.bat.

From https://stackoverflow.com/a/18045219/1178997 it looks like Visual Studio C++ 2010 needs to be installed on my particular machine.

This script will be deployed on a EC2 linux instance.

Will the need to install Visual Studio prevent me from being able to run the script on the linux server?

Am I installing the Pyahocorasick package incorrectly?

For reference I am attempting to implement @tobigue string comparison solution: https://stackoverflow.com/a/8289199/1178997

Thanks!

Edit: For development purposes I code and test on a Windows 7 box. For deployment purposes I will use a Linux EC2 instance. So far every library used has been cross-compatible. In using Pyahocorasick I want to verify there will not be any dependency problems in linux vs. windows.

Edit 2: Perhaps the real question is how to correctly install Pyahorcorasick in the first place. VC 2010 may not be needed to begin with which would solve the linux vs. windows problem.

Edit 3: After @cel correction on the packages proper spelling pip still throws an error because it is unable to find vcvarsall.bat. Presumably b/c this library uses an underlying C implementation of the Aho-Corasick automaton.

This brings about the original question of if vcvarsall.bat (a Visual Studio file) is necessary to install the library - how would this be correctly installed on a linux ec2 instance?

Community
  • 1
  • 1
w00tw00t111
  • 359
  • 5
  • 22
  • The `pyahocorasick` package contains extension modules written in C. Installing needs a working c compiler. On linux you usually have `gcc` or `clang`, so you should not have troubles installing it on a *nix system. `pip install pyahocorasick` should work. – cel Jan 21 '15 at 15:22
  • Your question title mentions Linux, whereas your question body talks about Windows. Could you please edit your question and clarify which OS you want to install on? – Frank Schmitt Jan 21 '15 at 15:30
  • @FrankSchmitt question edited. I think the real problem is how to install the Pyahorcorasick library. – w00tw00t111 Jan 21 '15 at 15:35
  • I think the main issues here are the names of the authors of this algorithm, Aho and Corasick. I would recommend editing your question and get the name of the package right. It's `pyahocorasick`, not `Pyahorcorasick` :) – cel Jan 21 '15 at 15:40
  • @cel yes, you're absolutely correct - typo on my part. When pip install pyahocorasick I still receive a pip error code 1. I'm running python 3.x and double checked that the package is 3 compatible. Not sure why it won't install. (ps, why do the names have to be so dang difficult to spell ;P) – w00tw00t111 Jan 21 '15 at 16:00
  • 1
    The pip distributed version of `pyaho*` is a C module, that needs a C compiler to be built. When you install on MSW VS10 is required, when you will install on Linux, GCC will be required to build the C module. On github you can find the [original implementation of the algorithm in pure python](https://github.com/WojciechMula/pyahocorasick/blob/master/py/pyahocorasick.py) if you don't want to mix with compilers. Be warned, though, that the author warns that there are subtle API differences between the C module and the pure python implementation. – gboffi Jan 21 '15 at 16:29
  • [Python Package Installation Options](https://pytools.codeplex.com/wikipage?title=PTVS%20Installation) – jfs Jan 21 '15 at 17:12
  • Different OSes require different (independent) instructions if C extensions are involved. `vcvarsall.bat` has *nothing* to do with Linux. – jfs Jan 21 '15 at 17:19
  • I am a committer on pyahocorasick... Are you all set now? The latest versions have been vastly improved. – Philippe Ombredanne Aug 17 '16 at 17:03

0 Answers0