2

Imagine the following situation:

  1. I'm working on a python project, and I install the library antigravity with pip.

  2. I add the function fly() which uses the library, and I commit and push the changes.

  3. Some time after, my partner(s) run git pull.

How do they know that they should install the new library? By failing to run the program? Because I told them so? Should the library install automatically? Is there any easy way of doing that?

For context, in case it's relevant, I'm using python 3 and the project is stored at github. Thanks.

  • 3
    This is what requirements files are for. Most workflows that reuse/automate Git usage will also automate package management , driven by a requirements.txt file. – Kilian Foth Feb 8 at 14:54
  • 2
    This question was already asked and answered in 2011 on Stackoverflow. See also this link – Doc Brown Feb 8 at 17:14
  • In C#, the Nuget package manager handles this; dependencies on third-party libraries are listed in a separate file (or the project file) and downloaded automatically if they don't exist on the machine. Is there something similar for python? – mmathis Feb 8 at 17:15
  • @mmathis: see my comment above. – Doc Brown Feb 8 at 17:18
  • 1
    @GuillermoMosse: thanks, but I don't write answers for things where I can only contribute a link (and the community here is strictly against link-only answers as well). I think, however, you should have invested a little bit more search effort into your question before asking, it took me less than a minute to find those links on Google. Try keywords "python automatic dependency" by yourself, you will find plenty of more links. – Doc Brown Feb 9 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.