What's the best practice for incorporating third-party libraries in a python program?

人走茶凉 提交于 2019-12-05 21:03:44

You basically have two options (just like you might recognize from Java).

One is to packaged the external dependencies in your app, meaning you copy all the dependencies into your apps directory structure. This is usually not recommended unless you must be able to ship a single installation or binary. In this case, you must be able to handle all supported platforms.

The better way to handle dependencies is to document what your apps dependencies are. One way to do this is to define a requirements.txt file in the pip format which can then be run by pip install -r requirements.txt, which will proceed to install all dependencies. Buildout is another option you can go with.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!