简体   繁体   中英

Private Git Repo in setup.py install_requires

I want pip to install a package "my_tools" from a private github repo whenever a package called "my_utils" is to be installed.

My 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']
)

I run: pip install -e. and get:

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)

None of these answers worked: 1 , 2 , 3

EDIT: I've also tried the following, but still not working:

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

Have you tried using http link instead of ssh?

git+http://git@github.company.com/org/My_Tools.git@2.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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