Ogen Ogen - 1 month ago 12
Python Question

Install git python library through python regardless of OS

I have developed a tool that my team can use after running the

setup.py
script. The tool requires this library: https://github.com/c2nes/javalang

How can I make my python setup script install this library on their computer regardless of what OS they are on. They can't run my tool without that library (Some people are on windows, mac, and linux.)

Answer

pip can install projects on Github as a dependency too!

All you need to do is, in your requirements.txt, add a line like following:

..
git+https://github.com/c2nes/javalang.git

then install the dependency using:

$ pip install -r requirements.txt