2

I'm using pip install git+http://github.com/myuser/myrepo.git#egg=myrepo (in a virtualenv of course) to install a package that I'm working on, and my git repo has a requirements.txt, but pip won't install it's dependencies. Is there a way to make this work similarly to when I use pip with a package from PyPI, so that my dependences will be installed automatically?

DennisLi
  • 3,915
  • 6
  • 30
  • 66
Broseph
  • 1,655
  • 1
  • 18
  • 38
  • You can use `pip install -r requirements.txt` – Avihoo Mamka May 01 '16 at 06:26
  • pip doesn't implicitly process any requirements.txt. however, if you'll add deps into setup.py - they will be installed even when installing package from git. – iced May 01 '16 at 06:39

1 Answers1

2

from my understanding pip only installs dependencies specified in the setup.py.

however if you prefer to use requirements to keep all dependencies, you may include requirements in setup.py by:

import os
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()

setup(...
    install_requires=required,
...)

code copied from: Reference requirements.txt for the install_requires kwarg in setuptools setup.py file?

Community
  • 1
  • 1
Guoliang
  • 885
  • 2
  • 12
  • 20