Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to include third party dependencies in Python app

What is the best way to distribute dependencies for an app?

Let's say I want to publish an app that depends on SqlAlchemy - is there a clean way to include SqlAlchemy in my repository without forcing the user to install it?

like image 824
Lucas Avatar asked Feb 16 '14 17:02

Lucas


1 Answers

Community standard is to use pip package manager with requirements file.

E.g.

SQLAlchemy>=0.9.8

It would force installing SQLAlchemy with version above or equal to 0.9.8.

If you want to distribute your code in standalone way, you may consider creating separate directory for 3rd party packages and extending PYTHONPATH environment variable.

export PYTHONPATH=$PYTHONPATH:/path/to/3rdpartypackages/

like image 77
Łukasz Rogalski Avatar answered Oct 15 '22 09:10

Łukasz Rogalski