在平坦的层中发现的多个顶级软件包
我正在尝试从来源使用诗歌的来源安装图书馆,但是我得到了这个错误,
error: Multiple top-level packages discovered in a flat-layout: ['tulips', 'fixtures'].
To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.
If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:
1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names
To find more information, look for "package discovery" on setuptools docs
我需要做什么来解决它?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
基于此评论在Github问题上
pyproject.toml
可能会解决您的问题:(对于我的情况,该评论中提供的其他解决方法,即添加
py_modules = []
作为ketup()setup.py
工作中的函数)请参见有关其他信息。
Based on this comment on a GitHub issue, adding the following lines to your
pyproject.toml
might solve your problem:(For my case, the other workaround provided in that comment, i.e. adding
py_modules=[]
as a keyword argument to the setup() function insetup.py
worked)See Package Discovery and Namespace Packages for additional information.
在
pyproject.toml
中添加以下内容为我工作。这是一个带有许多文件夹的存储夹,但只有一个文件夹具有包装代码:请参阅有关更多信息。
Adding the following in
pyproject.toml
worked for me. It was a repo with many folders but just one folder had the package code:See Package Discovery and Namespace Packages for more information.
我在安装模块
demo.py
时遇到了问题当目录中只有一个
*。py
脚本时, 。但是有几个*。py
脚本。它在包含参数
py_modules = ['demo']
中之后再次工作,setup()
呼叫。I got the problem when installing a module
demo.py
withIt works when there is only one
*.py
script in the directory. But there were several*.py
scripts.It works again after including also the argument
py_modules=['demo']
in thesetup()
call.