【问题标题】:PyPI & pip - installed package receive error reading README.mdPyPI & pip - 安装的包收到错误读取 README.md
【发布时间】:2015-12-22 11:43:07
【问题描述】:

我正在尝试安装我上传到 PyPI 的包,但由于某种原因,我总是收到关于 README.md 未找到的错误。

在本地运行 python setup.py develop 时效果很好,但是在将分发上传到 PyPI 后,我收到了我附加的错误:

这是我的 setup.py 文件:

from setuptools import setup, find_packages
import os

name = "AWS-Manager"
version = '0.2a'
description = "An open source project for managing your AWS resources easily in your day to day coding"
long_description = "README.md"
author = 'Asaf Nevo, Aviv Paz',
author_email = 'asafnevo1@gmail.com, avivpaz43556@gmail.com'
license_type = "GNU"
keywords = 'aws ec2 amazon servers vpc awscli'


def read(file_name):
    """
    Read a text file in the Root directory
    :param str file_name: the name of the file
    :return: the content of the text file
    :rtype: str
    """
    return open(os.path.join(os.path.dirname(os.path.realpath(__file__)), file_name)).read()


setup(
        author=author,
        author_email=author_email,
        name=name,
        version=version,
        license=license_type,
        description=description,
        long_description=read(long_description),
        packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
        install_requires=["boto3"],
        entry_points={
            'console_scripts': [
                'awsmanager = aws_manager.main:main',
            ],
        },
        keywords=keywords,
        zip_safe=False,
        include_package_data=True
)

running sudo -H pip install AWS-Manager 时出现此错误

Collecting AWS-Manager
  Downloading AWS-Manager-0.2a0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/tmp/pip-build-9nio8w/AWS-Manager/setup.py", line 31, in <module>
        long_description=read(long_description),
      File "/private/tmp/pip-build-9nio8w/AWS-Manager/setup.py", line 21, in read
        return open(os.path.join(os.path.dirname(os.path.realpath(__file__)), file_name)).read()
    IOError: [Errno 2] No such file or directory: '/private/tmp/pip-build-9nio8w/AWS-Manager/README.md'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-9nio8w/AWS-Manager

【问题讨论】:

    标签: python pip setuptools


    【解决方案1】:

    对此的解决方案是在顶级目录中创建一个MANIFEST.in,其中包含您要包含在分发中的其他文件的行,例如,

    include README.md
    include LICENSE.txt`
    

    据报道工作here。 这也解决了我的分发问题。

    我不知道具体是什么原因造成的,但它可能与 PyPI 被更新为仅支持由 PyPI described in this PEP 直接托管的文件有关。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-08
      • 2020-02-12
      相关资源
      最近更新 更多