V
V
valentin_dev2021-11-12 15:03:34
Building projects
valentin_dev, 2021-11-12 15:03:34

Is it possible to build a python script with all dependencies into one file?

There is a Python script, it was written in Windows, it needs to be transferred to Linux, there is no way to install a bunch of libraries on a Linux machine. How can I build it so that I can copy it to Linux and execute it there with the python script.py command?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-11-12
@Vindicar

It is impossible, because among the dependencies there may be modules written not in python, but in C. They depend on the OS and architecture of the processor.
You can create a virtual environment on Linux and put the dependencies there instead of directly into the system.
Or you can use the docker image, but I don’t know how docker is friends with Windows, since I didn’t use it. Again, docker is a rather resource-intensive thing, and is only useful when you often drag a working project back and forth.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question