【发布时间】:2019-06-29 19:16:29
【问题描述】:
我正在使用 dpkg-buildpackage 构建 python 模块的 .deb 包。
在 setup.py 我指定了install_requires=['othermodule>=2.0']
但是生成的 control 文件没有指定版本。 Depends: python (>= 2.7), othermodule,
dh_python 正在根据 setup.py 文件猜测需求。但是dh_python2 的联机帮助页指出
(默认忽略版本要求)
但我无法将版本包含在控制文件中。 问题是如果没有包含的版本 .deb 包被安装但随后启动我得到的程序:
pkg_resources.DistributionNotFound: The 'othermodule>=2.0' distribution was not found and is required by ...
因为安装的版本低于2.0
我希望能够只指定一次依赖版本(例如在 setup.py 中)
[编辑:]
我在 pydist.py 中看到函数 load() 在绝对路径中搜索:
def load(dname='/usr/share/python/dist/', fname='debian/pydist-overrides',
fbname='/usr/share/python/dist_fallback'):
而不是在我的包结构所在的 ./debian 下。由于该软件包尚未安装(我正在构建它),因此找不到 pydist 文件。我错过了什么吗???
【问题讨论】:
-
尝试使用 debian 文件夹中的 pydist 文件:
OthermoduleName python-othermodule; PEP386但没有结果
标签: python version setup.py deb install-requires