Domanda

Sto provando ad installare pycassa , un client Cassandra in Python, su Windows 7 .

pip install pycassa esecuzione ho ricevuto questo messaggio di errore:

error: unable to find vcvarsall.bat

Scavando più a fondo, ho scoperto che Python non è riuscito a installare la libreria parsimonia e binding Python. Un modo persone suggeriscono è quella di installare un compilatore C ++, ad esempio Visual Studio 2008 Express , o mingw su Windows 7, e compilazione Thrift dalla sorgente.

Tuttavia, ho trovato una versione on-line compilato of Thrift . C'è un modo di impegnare la versione compilata di Thrift in Python e quindi utilizzarlo in pycassa? O devo passare attraverso la compilazione dai sorgenti parsimonia?

È stato utile?

Soluzione

Thrift really has two (kinds of) components: there's the Thrift compiler, which generates code given an interface, and then there are the per-language libraries, which implement the low-level thrift protocols and transports for each language.

You almost certainly don't need the Thrift compiler, which is what you linked to. You do need the Thrift python library; pip attempts to install this as a dependency for pycassa. The reason that it's breaking is that there is a C extension that is included in the Thrift python library, and during the installation process, it tries to compile that. For the compilation to work, you need to do a few things specially.

If you're just doing this for development purposes, you can download the latest Thrift python library manually, remove src/protocol/fastbinary.c, and then run 'setup.py install' from the top-level directory. This will be slower than if you have the extension compiled and installed, but for dev purposes, it will work fine. You can use 'pip install --no-deps pycassa' at this point, and it won't try to install Thrift automatically, just pycassa.

If you're doing this for production, you will likely want the C extension to be compiled and installed. To do this, you need to install Visual C++ 2008 Express Edition, check out the latest version of Thrift from SVN, go to the lib/py directory, and run 'setup.py install' there.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top