Vendor Python Dependencies

#codesnippet #python

Install dependencies to vendor/ folder.

pip install -r requirements.txt -t vendor/

Have Python search for dependencies in vendor/ folder.

import sys
sys.path.append('vendor')

Or, set the PYTHONPATH directly.

PYTHONPATH=vendor python my_script.py