在setup.py的install_requires中如何使用私有Git仓库?

3

我希望在安装名为“my_utils”的包时,使用pip从私有的github repo安装一个名为“my_tools”的包。

我的setup.py文件内容如下:

from setuptools import setup

setup(
    name="my_utils",
    version="1.0",
    description="Common utility tools",
    author="author",
    packages=['my_utils'],
    include_package_data=True,
    python_requires=">=3.6",
    install_requires=[
        'pandas',
        'requests',
        'my_tools@git+ssh://git@github.company.com/org/My_Tools.git@2.0'
    ],
    dependency_links=['git+ssh://git@github.company.com/org/My_Tools.git@2.0']
)

我运行了以下命令:pip install -e .,并获得以下输出:
Requirement already satisfied: pandas ....
Requirement already satisfied: requests ....
ERROR: Could not find a version that satisfies the requirement my-tools (unavailable) (from my-utils) (from versions: none)
ERROR: No matching distribution found for my-tools (unavailable)

这些答案都无法解决问题:123

补充说明:我还尝试了以下方法,但仍然无效:

install_requires=[
    'my_tools @ git+ssh://git@github.company.com/org/My_Tools.git@2.0'
]
1个回答

0
你尝试过使用 HTTP 链接而不是 SSH 吗?
git+http://git@github.company.com/org/My_Tools.git@2.0

2
这只是对原帖的评论,而不是作为答案的问题。 - amaster
SSH是我们公司的最佳实践。当我尝试使用git+https://... URL时,它提示我登录,登录成功,但结果仍然是相同的错误。 - Wassadamo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接