【发布时间】: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