Creating a Portable Python (local install) for Linux

后端 未结 7 1144
醉酒成梦
醉酒成梦 2021-02-07 15:53

I\'m looking to create the following:

A portable version of python that can be run on any system (with any previous version of python or no python installed) and have it

7条回答
  •  遇见更好的自我
    2021-02-07 16:41

    One nice option is to make a "snap" portable linux application. They have a python mode which lets you specify you specify exactly what modules you need. From https://snapcraft.io/first-snap#python :

    Snaps let you distribute a dependency-isolated Python app in an app store experience for end users.

    Another option is to containerize your application with something like docker. Then instead of executing your script directly, the user is actually running a small OS with just your application and its dependencies. https://www.infoq.com/articles/docker-executable-images/ has more about executable containers.

    Container images can also be used for short lived processes: a containerized executable meant to be run on your computer. These containers execute a single task, are short lived and can generally be removed after use. We call these executable images. Examples are compilers (Golang) or build tools (Maven), presentation software (I love to hack a simple presentation in Markdown format and let a RevealJS Docker image serve that) and browsers (a fresh contained browser to follow that fishy link). A real evangelist for executable images is Docker's own Jessie Frazelle. To get some great inspiration be sure to read her blog about them or check out this presentation at DockerCon 2015.

提交回复
热议问题