简体   繁体   中英

Python: How to install a third-party package and make it available to rest of team

My team uses git to track the code and we want to do the following: (1) One team-member installs a third-party python package and (2) makes it available on our git repo, so that the rest of the team can simply install the package by pulling the latest version of our code.

Is that possible at all? If so, what are feasible solutions? If not, what approach works best in your experience?

Background: We are using python 2.7.*. The third-party package is testfixtures to unittest the logging of our software. We use Windows and Mac.

Create a requirements.txt file and place it in your directory. Each line in the file should contain the name of a package that your entire team should have installed. Your team members, once they have the new version of the file, can run pip install -r requirements.txt . Then, update the requirements.txt file every time you have a new package required, and rerun the command.

Some editors (like PyCharm) will even automatically detect a requirements file and prompt you to install the packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM