简体   繁体   English

使用 setup.py 中的 dependency_links 从 svn 安装 python package

[英]Install python package from svn using dependency_links in setup.py

I am trying to install hw3 package which has a dependency package hw2.我正在尝试安装具有依赖 package hw2 的 hw3 package。 My setup.py looks as follows -我的 setup.py 如下所示 -

setup(
    name='hw3',
    version='0.1',
    packages = find_packages(),
    install_requires = 'hw2',
    dependency_links = [
        r'svn+https://server.local/svn/Libraries/testPkg2/trunk#egg=hw2'
    ]
)

I get the following error when I run python setup.py install in windows cmd当我在 windows cmd 中运行 python setup.py install 时出现以下错误

svn: E170013: Unable to connect to a repository at URL 'svn+https://server.local/svn/Libraries/testPkg2/trunk'
svn: E125002: Undefined tunnel scheme 'https'

Alternatively, I have requirements.txt which is as follows或者,我有 requirements.txt 如下

svn+https://server.local/svn/Libraries/testPkg2/trunk#egg=hw2 

If I run pip install -r requirements.txt, it installs hw2 package successfully.如果我运行 pip install -r requirements.txt,它会成功安装 hw2 package。

My svn version is我的 svn 版本是

svn, version 1.9.7 (r1800392) compiled Aug 8 2017, 22:14:48 on x86-microsoft-windows svn,版本 1.9.7 (r1800392) 在 x86-microsoft-windows 上于 2017 年 8 月 8 日 22:14:48 编译

how to resolve this error?如何解决此错误? Thanks谢谢

I am getting the same error for 'http' and 'svn'.对于“http”和“svn”,我遇到了同样的错误。

For 'ssh' it is对于 'ssh' 它是

svn: E170012: Can't create tunnel
svn: E720002: Can't create tunnel: The system cannot find the file specified.

Maybe try it directly with the install_requires option (requires pip>=18.1):也许直接用install_requires选项试试(需要 pip>=18.1):

setup(
    name='hw3',
    version='0.1',
    packages = find_packages(),
    install_requires = ['hw2@svn+https://server.local/svn/Libraries/testPkg2/trunk#egg=hw2'],
)

See also this answer to a related question https://stackoverflow.com/a/54216163/13835019 .另请参阅相关问题https://stackoverflow.com/a/54216163/13835019的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM