简体   繁体   中英

Installing a .tar.bz2 in windows

I am a newbie to installing python extensions working on Windows 7, running Python 2.6 - I need to install the Levenshtein library from

http://code.google.com/p/pylevenshtein/downloads/detail?name=python-Levenshtein-0.10.1.tar.bz2&can=2&q=

When I unzip the downloaded file, it gives me the following list of files:

  • COPYING
  • gendoc.sh
  • Levenshtein.c
  • Levenshtein.h
  • MANIFEST
  • NEWS
  • PKG-INFO
  • README
  • setup.cfg
  • setup.py
  • StringMatcher.py

How do I install the Levenshtein library so I could import and use it into my python code?

Here is quite a large section of the documentation easily found by doing some research .

http://docs.python.org/install/index.html

It appears that you will want to run:

python setup.py install --prefix="\Temp\Python"

to install modules to the \\Temp\\Python directory on the current drive.

Some more info:

If you don't choose an installation directory—ie, if you just run setup.py install—then the install command installs to the standard location for third-party Python modules.

The default installation directory on Windows was C:\\Program Files\\Python under Python 1.6a1, 1.5.2, and earlier.

Assuming you have Python already installed on on you PATH, you can do this:

python setup.py install

However, it seems to have a compiled extension so you will probably also need a complete Windows development environment to install that (it is a source distribution). So if you don't it may not work. Your best bet would be to find that as an MSI package, if you can.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM