在中指定依赖项url设置.py对于PyPI中的模块

2024-06-01 19:49:41 发布

您现在位置:Python中文网/ 问答频道 /正文

到目前为止,我在这里看到的问题处理的是相反的情况,即providing a link to off-PyPI dependencies。在我的例子中,依赖项是用PyPI发布的,但是版本不能满足我的要求。这是我的setup.py的节选

setup(
    ...
    install_requires=["numpy>=1.11.0",
                      "scipy>=0.17.0",
                      "lasagne",
                      "Theano>=0.8.1",
                      "scipy>=0.17.0"],

    dependency_links=["git+https://github.com/Lasagne/Lasagne.git#egg=lasagne"]
)

我需要从链接安装lasagne,而{}坚持安装PyPI版本。在

编辑。我试过这么做

^{pr2}$

这导致Could not find a version that satisfies the requirement lasagne>=0.2.dev1

编辑2

实际上,传递--process-dependency-links标志,如here(多亏了nehalj.Wani)使其工作。如何使此标志在默认情况下工作?我不想让用户感到困惑。在


Tags: togit版本pypi编辑标志setuplink