What's the standard way to package a python project with dependencies?

前端 未结 3 1503
野性不改
野性不改 2021-01-14 00:55

I have a python project that has a few dependencies (defined under install_requires in setup.py). My ops people requires a package to be self contained and only

3条回答
  •  别那么骄傲
    2021-01-14 01:23

    It's possible to do this with recent versions of pip (I'm using 8.1.2). On the build machine:

    pip install -r requirements.txt --prefix vendor
    

    Then run it:

    PYTHONPATH=vendor/lib/python2.7/site-packages python yourapp.py
    

    (This is basically an expansion of @valentjedi comment. Thanks!)

提交回复
热议问题