What is the best practice for incorporating third-party libraries into a python program?

Good afternoon.

I am writing a small and medium python program for my work. The task requires me to use the Excel xlwt and xlrd libraries , as well as the Oracle database query library called cx_Oracle . I am developing a project through a version control system, namely CVS.

I was wondering what a standard way to organize third-party libraries around a python project. Should the xlwt, xlrd, and cx_Oracle libraries be stored in a directory such as / usr / local / lib / python, which supposedly has its place in PYTHONPATH? Or if third-party libraries are instead included in the same directory as the project source code, effectively "sent" with the project, so the python script is more platform independent.

I am just looking for best practices since I am coming from Java and new to Python.

Thanks in advance,
KTM

+3
source share
1 answer

You basically have two options (just as you would recognize Java).

, , . , . .

- . - requirements.txt pip, pip install -r requirements.txt, . Buildout - , .

+5

All Articles