1

我有setup.py一个模块的脚本。此setup.py脚本具有将 Markdown README 文件转换为 reStructuredText(适用于 PyPI)的功能。当尝试使用 pip ( sudo pip install supermodule) 安装此模块时,会出现以下错误:

Collecting supermodule
  Downloading supermodule-2017.1.12.2329.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-GijMOu/supermodule/setup.py", line 43, in <module>
        main()
      File "/tmp/pip-build-GijMOu/supermodule/setup.py", line 14, in main
        long_description = pypandoc.convert("README.md", "rst"),
      File "/usr/local/lib/python2.7/dist-packages/pypandoc/__init__.py", line 50, in convert
        outputfile=outputfile, filters=filters)
      File "/usr/local/lib/python2.7/dist-packages/pypandoc/__init__.py", line 68, in _convert
        raise RuntimeError('Missing format!')
    RuntimeError: Missing format!

出了什么问题,我该如何解决?

setup.py脚本如下:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import pypandoc
import setuptools

def main():

    setuptools.setup(
        name             = "supermodule",
        version          = "2017.01.12.2329",
        description      = "super module",
        long_description = pypandoc.convert("README.md", "rst"),
        url              = "https://github.com/user/supermodule",
        author           = "A. Person",
        author_email     = "ap@sern.ch",
        license          = "GPLv3",
        py_modules       = [
                           "supermodule"
                           ],
        install_requires = [
                           "opencv",
                           "docopt",
                           "propyte",
                           "shijian",
                           "tonescale"
                           ],
        scripts          = [
                           "supermodule_test.py"
                           ],
        entry_points     = """
            [console_scripts]
            supermodule = supermodule:supermodule
        """
    )

def read(*paths):
    with open(os.path.join(*paths), "r") as filename:
        return filename.read()

if __name__ == "__main__":
    main()
4

0 回答 0