Is there a way to embed dependencies within a python script?

后端 未结 3 730
失恋的感觉
失恋的感觉 2020-12-24 07:10

I have a simple script that has a dependency on dnspython for parsing zone files. I would like to distribute this script as a single .py that users can run just so long as

3条回答
  •  生来不讨喜
    2020-12-24 07:28

    please don't do this. If you do DO NOT make a habit of it.

    • pydns is BDS licensed but if you try to "embed" a gpl module in this way you could get in trouble
    • you can learn to use setuptools and you will be much happier in the long run
    • setuptools will handle the install of dependencies you identified (I'm not sure if the pydns you are using is pure python so you might create problems for your users if you try to add it yourself without knowing their environment)
    • you can set a url or pypi so that people could upgrade your script with easy_install -U

提交回复
热议问题