如何安装和使用open-tamil包?

时间:2014-05-16 05:21:57

标签: python python-2.7

我想使用open-tamil包来处理tamil文本。 我将它下载为" open-tamil-master"包含setup.py文件的包。但是在运行文件时它说"错误没有提供命令"。 也可在https://github.com/arcturusannamalai/open-tamil中找到 可以有人说我如何安装和使用它?

1 个答案:

答案 0 :(得分:2)

要下载并安装(使用setup.py)open-tamil,您可以执行以下操作

git clone https://github.com/arcturusannamalai/open-tamil.git
cd open-tamil
sudo python setup.py install

它说“错误没有提供命令”

这是因为您需要通过提供命令告诉setup.py要做什么。在这种情况下,install

现在您可以导入其模块等:

tim@tim-N53SN:~$ python
Python 2.7.3 (default, Feb 27 2014, 19:58:35) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import transliterate
>>> import tamil
>>>

您可以为setup.py提供哪些命令的完整列表:

Standard commands:
  build            build everything needed to install
  build_py         "build" pure Python modules (copy to build directory)
  build_ext        build C/C++ extensions (compile/link to build directory)
  build_clib       build C/C++ libraries used by Python extensions
  build_scripts    "build" scripts (copy and fixup #! line)
  clean            clean up temporary files from 'build' command
  install          install everything from build directory
  install_lib      install all Python modules (extensions and pure Python)
  install_headers  install C/C++ header files
  install_scripts  install scripts (Python or otherwise)
  install_data     install data files
  sdist            create a source distribution (tarball, zip file, etc.)
  register         register the distribution with the Python package index
  bdist            create a built (binary) distribution
  bdist_dumb       create a "dumb" built distribution
  bdist_rpm        create an RPM distribution
  bdist_wininst    create an executable installer for MS Windows
  upload           upload binary package to PyPI
  check            perform some checks on the package