在 setup.py 中为 PyPI 中的模块指定依赖 url

Eli*_*igo 5 python pip setuptools pypi setup.py

到目前为止,我在这里看到的问题处理相反的情况,即提供指向 off-PyPI 依赖项的链接。就我而言,依赖项是在 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"]
)
Run Code Online (Sandbox Code Playgroud)

我需要lasagne从链接安装,同时pip坚持安装PyPI版本。

编辑。我试过这样做

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

    dependency_links=[
        "git+https://github.com/Lasagne/Lasagne.git#egg=lasagne-0.2.dev1"]
)
Run Code Online (Sandbox Code Playgroud)

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

编辑2

实际上通过此处--process-dependency-links所示的标志(感谢 Nehal J. Wani)使其工作。我怎样才能让这个标志默认工作?我不希望用户感到困惑。