I've made a python script that depends of numpy, cv2 and some other modules to run and need to run it on a Linux server where I'm not allowed to install anything. Is there a way to join all that stuff into a single executable that runs without installing anything?
Asked
Active
Viewed 84 times
1
-
1That depends. Does the Linux server have Python and pip? Can you create a [virtualenv](https://virtualenv.pypa.io/en/table/)? Else look at https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency and https://stackoverflow.com/questions/4556424/how-to-make-my-python-script-easy-portable-or-how-to-compile-into-binary-with-a – Jedi Jul 06 '17 at 03:53
-
@Jedi It has python installed, pip I believe it doesn't, I'm not allowed to create a virtualenv. – MickJaggerr Jul 06 '17 at 03:58
-
You can try to use the method described in https://stackoverflow.com/questions/12332975/installing-python-module-within-code – Mia Jul 06 '17 at 03:59
2 Answers
2
It sounds like you're looking for PyInstaller, which bundles all the modules your script depends on into a single program. It even includes Python itself. There are a few alternatives, some of which are listed on this page.

Arthur Tacca
- 8,833
- 2
- 31
- 49