自建包索引的问题

2 投票
2 回答
4192 浏览
提问于 2025-04-17 12:39

我在我的网站上放了一些“蛋”,目的是创建自己的软件包索引:

http://mnowotka.kei.pl/eggs/

现在我想在我的构建配置中使用这个索引:

[buildout]
...
find-links = ...
             http://mnowotka.kei.pl/eggs/

这样我就可以让这个索引中的一些软件包在我的本地Python解释器中可用:

[python]
...
eggs = ...
dashboard-common

但是,当我执行 ./bin/buildout 时,出现了以下错误:

Couldn't find index page for 'dashboard-common' (maybe misspelled?)
Getting distribution for 'dashboard-dommon'.
While:
   Installing python.
   Getting distribution for 'dashboard-common'.
Error:
   Couldn't find a distribution for 'dashboard-common'.

有没有人知道这里可能出什么问题?

2 个回答

1

你的蛋(egg)叫做 http://mnowotka.kei.pl/eggs/dashboard_common-0.5-py2.7.egg,名字里有个下划线,叫做 dashboard_common。而你在查询的时候用的是带连字符的 dashboard-common。

这两个名字不一样,这就是问题所在。去你的 setup.py 文件里,把包的名字改成 dashboard-common。至于你在代码里引入的那个包,还是可以保持为 dashboard_common。

1

问题不在于下划线或破折号,实际上在蛋名称中使用下划线,而在构建需求中使用破折号是正确的。问题的根源在于蛋的名称——“...py2.7...”当我使用的是Python 2.6版本时,构建工具不想安装这个版本。因为没有其他选择,所以我收到了这些提示信息。

撰写回答