I am developing a Python app in Debian Linux. I have my code ready and it works well on my machine with all its dependencies and modules installed.
However the purpose of this application is to be shared with different people and work for them without the need to install neither Python, nor any of its dependencies. I also have the requirement to not use Docker.
So with all this said, I thought I may be able to install Python in a certain directory, then create a tar file from it and somehow (magically) this would work on any other LINUX machine.
So it turned out that is not the way it works.
How can I achieve something like this?
2
Answers
You have two solutions – use different mechanism for making container (like podman) or create virtualenv and use it to run python on different machine.
Note that virtualenvs can be little… wonky. If you copy it from Intel to ARM Mac it probably will work, but if you copy it from Windows PC to Raspberry Pi or even from Linux x86-64 machine to Raspberry Pi it won’t. And probably there will be another hassle running it since python is somewhat linked to system libraries.
I don’t get why you don’t want to use Docker, it works just fine and is the best "friendly" scenario for your problem.
Try to convert it into an executable file such as ".exe" (for windows) or ".elf" (for linux). This will allow you to run the program without installing python or any other dependencies.