このpip install protocol+location[@tag][#egg=Dependency]
形式を使用して、pip を使用してソースから直接インストールできます。
ギット
pip install git+https://github.com/username/repo.git
pip install git+https://github.com/username/repo.git@MyTag
pip install git+https://github.com/username/repo.git@MyTag#egg=ProjectName
マーキュリアル
pip install hg+https://hg.myproject.org/MyProject/
SVN
pip install svn+svn://svn.myproject.org/svn/MyProject
Bzr
pip install bzr+http://bzr.myproject.org/MyProject/trunk
次のプロトコルがサポートされています。[+git, +svn, +hg, +bzr]
バージョン
@tag
チェックアウトする特定のバージョン/タグを指定できます。
#egg=name
他のプロジェクトの依存関係としてプロジェクトを指定できます。
順序は常に である必要があります@tag#egg=name
。
プライベート リポジトリ
ssh://
プロトコルを SSH に変更し ( )、適切なユーザーを追加する( )ことにより、プライベート リポジトリからインストールすることもできますgit@
。
git+ssh://git@github.com/username/my_private_repo
ユーザー名/パスワードを使用して、プライベート リポジトリからインストールすることもできます。
git+https://<username>:<password>@github.com/<user>/<repo>.git
Github は、循環可能な個人用 OAuth トークンを作成する機能を提供します
git+https://<oauth token>:x-oauth-basic@github.com/<user>/<repo>.git
要件.txt
requirements.txt
プロジェクトの依存関係を指定するために使用されます。
要件.txt
package1
package2==1.0.2
package3>=0.0.4
git+https://github.com/username/repo.git
これらはパッケージで自動的にインストールされないため、コマンドでインストールする必要がありますpip -r requirements.txt
。
要件ファイルを含める
要件ファイルには、他の要件ファイルを含めることができます。
要件-docs.txt
sphinx
-r requirements-dev.txt
要件-dev.txt
some-dev-tool
-r requirements.txt
要件.txt
package1
package2==1.0.2
package3>=0.0.4
git+https://github.com/username/repo.git
setup.py
要件ファイルはsetup.py
、次のコマンドで指定された依存関係をインストールできます。
-e .
setup.py
上記と同じ構文を使用してリポジトリからインストールすることもできますが、この回答dependency_links
に記載されている値を使用します。
参考文献:
https://pip.pypa.io/en/latest/user_guide.html#installing-packages
https://pip.pypa.io/en/latest/reference/pip_install.html