我有一個私人圖書館稱爲some-library
(實際名稱已被更改)有一個安裝文件看有點像這樣:如何`pip安裝`具有Git依賴關係的軟件包?
setup(
name='some-library',
// Omitted some less important stuff here...
install_requires=[
'some-git-dependency',
'another-git-dependency',
],
dependency_links=[
'git+ssh://[email protected]/my-organization/some-git-dependency.git#egg=some-git-dependency',
'git+ssh://[email protected]/my-organization/another-git-dependency.git#egg=another-git-dependency',
],
)
所有這些混帳依賴可能是私有的,所以installation via HTTP不是選項。我可以在some-library
的根目錄下使用python setup.py install
和python setup.py develop
,沒有問題。
但是,安裝過了Git不起作用:
pip install -vvv -e 'git+ssh://[email protected]/my-organization/[email protected]#egg=some-library'
在查找some-git-dependency
命令失敗,錯誤地假定它需要得到一封來自PyPI的依賴關係,然後總結它不是PyPI上的失敗後。我的第一個猜測是嘗試重新運行與--process-dependency-links
的命令,但後來發生這種情況:
Cannot look at git URL git+ssh://[email protected]/my-organization/some-git-dependency.git#egg=some-git-dependency
Could not find a version that satisfies the requirement some-git-dependency (from some-library) (from versions:)
爲什麼生產這種模糊的錯誤? pip install
包含Git依賴關係的包可能是私有的正確方法是什麼?
你試過'--process-dependency-links -allow-all-external'。 –