1

I have python (3.0) code base for backend.

I want to deploy this code as bundle on other machine so that it does not require to install dependencies.

Note 1: on my remote machine i have python installed not an issue.

Note 2: This app is not containerized (docker)

Note 3: After bundling it i have to run program on command line with some input argument to the program

(Like for Node Js based app we use Webpack and it just bundles all the js and dependencies into one JS file which can be run from any machine without having node_modules.)

I see some are there like 'python-webpack' but they are unmaintained.

sanjesh
  • 169
  • 2
  • 12
  • 1
    You mean like creating an executable? – code11 Jan 29 '21 at 17:25
  • 1
    Does this answer your question? [How can I make a Python script standalone executable to run without ANY dependency?](https://stackoverflow.com/questions/5458048/how-can-i-make-a-python-script-standalone-executable-to-run-without-any-dependen) – code11 Jan 29 '21 at 17:26
  • 1
    Docker is not an option? – OneCricketeer Jan 29 '21 at 17:28
  • yes kind of executable like in nodejs the bundled js file can be run from other machine if node js is installed. Here my program take inputs from command prompt. – sanjesh Jan 29 '21 at 17:35
  • I tried PyInstaller and it creates exe file and i have to run my final bundled file on command prompt with two input arguments – sanjesh Jan 29 '21 at 23:12
  • What was the problem when you tried to run the exe file from the command prompt and provided two arguments? – mkrieger1 Jan 30 '21 at 00:43
  • with argument error: dateutil\zoneinfo\__init__.py:26: UserWarning: I/O error(2): No such file or directory CRITICAL:root:No valid argument found or invalid json format. – sanjesh Jan 30 '21 at 04:44
  • With no argument: Traceback (most recent call last): File "myPyFile.py", line 89, in IndexError: list index out of range [36044] Failed to execute script myPyFile – sanjesh Jan 30 '21 at 04:48
  • so arguments should be enclosed in double quotes...I am able to run my generated single exe file on command prompt with required argument. – sanjesh Jan 31 '21 at 03:59
  • does this exe file run inside workspace (' / dist / myfile.exe') only ????. Because if i copy this exe out of workspace then on running it just execute without any error and does not generate my output at all. – sanjesh Jan 31 '21 at 04:02

0 Answers0