当你遇到这样的错误时,首先要检查的事情之一是在你构建它时哪些包实际上被添加到你的发行版中。在您的情况下,包列表为空,但应至少包含pulp_hook
包:
$ python -c "from setuptools import find_packages; print(find_packages())"
[]
那么为什么不setuptools
识别pulp_hook
为常规包呢?查看它的结构:您添加了名为 的文件__init.py__
,但它的名称应该是__init__.py
. 重命名文件后,pulp_hook
及其子目录将成为常规包:
$ python -c "from setuptools import find_packages; print(find_packages())"
['pulp_hook', 'pulp_hook.plugins', 'pulp_hook.plugins.distributors']
Nowbuild/lib
将被创建,因为 nowdistutils
找到至少一个要安装的包:
$ python setup.py install_lib
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/pulp_hook
copying pulp_hook/__init__.py -> build/lib/pulp_hook
creating build/lib/pulp_hook/plugins
copying pulp_hook/plugins/__init__.py -> build/lib/pulp_hook/plugins
creating build/lib/pulp_hook/plugins/distributors
copying pulp_hook/plugins/distributors/distributionhook.py -> build/lib/pulp_hook/plugins/distributors
copying pulp_hook/plugins/distributors/__init__.py -> build/lib/pulp_hook/plugins/distributors