9

I have following two repositories: one classic with setup.py, and second which looks like:

/repo /folder1 /folder2 /utils /setup.py

and in setup.py in first repo I want install utils from second repo. I tried following code:

install_requires=["repo"],
dependency_links=['git+ssh://[email protected]:0000/project/repo@master#egg=repo&subdirectory=folder2']

but after python setup.py develop I have following error:

unknown url type: git+ssh -- Some packages may not be found!

3

2 Answers 2

4

I had the same issue.

janfreyberg answer does not work anymore because of a change in pip: since 19.0, dependency_links are now obsolete.

Since pip 18.1, we can put these dependencies in install_requires using a syntax introduced by PEP 508.

Here is the solution in your case:

install_requires=[
    'repo @ git+ssh://[email protected]:0000/project/repo@master#subdirectory=folder2'
]

setup(install_requires=install_requires)

Note that this requires using pip install . and doesn't work with python setup.py install.

If folder2 itself has dependencies, everything will be retrieved recursively.

Sign up to request clarification or add additional context in comments.

Comments

2

I found this works for me:

depndendcy_links=["git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI#egg=pycocotools-2.0"]

So, specify the subdirectory and version as #subdirectory=<sub_dir>#<packagename>-<version>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.