Python PyPI&;pip-已安装的包在读取README.md时收到错误
我正在尝试安装我上传到PyPI的软件包,但由于某些原因,我总是收到一个关于README.md的错误,但没有找到 在本地运行python setup.py develope时,它工作得很好,但是在将发行版上载到PyPI之后,我收到了附加的错误: 这是我的setup.py文件:Python PyPI&;pip-已安装的包在读取README.md时收到错误,python,pip,setuptools,Python,Pip,Setuptools,我正在尝试安装我上传到PyPI的软件包,但由于某些原因,我总是收到一个关于README.md的错误,但没有找到 在本地运行python setup.py develope时,它工作得很好,但是在将发行版上载到PyPI之后,我收到了附加的错误: 这是我的setup.py文件: from setuptools import setup, find_packages import os name = "AWS-Manager" version = '0.2a' description = "An o
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
)
当运行sudo-H pip安装AWS管理器时,这是一个错误
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
收集AWS管理器
下载AWS-Manager-0.2a0.tar.gz
从命令python setup.py egg_info完成输出:
回溯(最近一次呼叫最后一次):
文件“”,第20行,在
文件“/private/tmp/pip-build-9nio8w/AWS-Manager/setup.py”,第31行,在
长描述=读取(长描述),
文件“/private/tmp/pip-build-9nio8w/AWS Manager/setup.py”,第21行,已读
返回open(os.path.join(os.path.dirname(os.path.realpath(_文件__)),file_名称)).read()
IOError:[Errno 2]没有这样的文件或目录:'/private/tmp/pip-build-9nio8w/AWS-Manager/README.md'
----------------------------------------
命令“python setup.py egg_info”在/private/tmp/pip-build-9nio8w/AWS Manager中失败,错误代码为1
解决方案是在顶级目录中创建一个清单,其中包含要包含在分发中的其他文件的行,例如
include README.md
include LICENSE.txt`
据报道,他正在工作。
这也解决了我的发行版的问题
我不知道到底是什么原因导致了这种情况,但这可能与PyPI被更新为仅支持PyPI直接托管的文件有关