bugy / script-server

Web UI for your scripts with execution management
Other
1.55k stars 246 forks source link

I cant run my python scripts : (( #598

Closed chrsBlank closed 1 year ago

chrsBlank commented 1 year ago

hi, I was trying to run my scripts but i get the following error: Calling the script...

--- ERRORS --- Exec format error

my script is in python and i have all the modules install (libraries) since im able to run the script in the terminal with: "python3 " and it runs normally. Sadly i cant post the script code(nda) but im sure it works fine. My installation is in portainer as a container by it self and the web interface works fine ( even the admin panel works remotely)

Why do i get the error?

bugy commented 1 year ago

Hi, please try this one: https://stackoverflow.com/a/30551364

YasTouchedMySpaggett @.***> schrieb am So., 27. Nov. 2022, 10:23:

hi, I was trying to run my scripts but i get the following error: Calling the script...

--- ERRORS --- Exec format error

my script is in python and i have all the modules install (libraries) since im able to run the script in the terminal with: "python3 " and it runs normally. Sadly i cant post the script code(nda) but im sure it works fine. My installation is in portainer as a container by it self and the web interface works fine ( even the admin panel works remotely)

Why do i get the error?

— Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJXPJOU4ROBFH2GAGRJZIDWKMSBHANCNFSM6AAAAAASMNR42I . You are receiving this because you are subscribed to this thread.Message ID: @.***>

chrsBlank commented 1 year ago

its not a shell script, just python, and i uploaded the script from the admin panel. So it does not have permission issues.

bugy commented 1 year ago

Do you have a shebang in the script?

YasTouchedMySpaggett @.***> schrieb am So., 27. Nov. 2022, 12:05:

its not a shell script, just python, and i uploaded the script from the admin panel. So it does not have permission issues.

— Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/598#issuecomment-1328222104, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJXPJN5PH6BUEBGVGX7MWLWKM557ANCNFSM6AAAAAASMNR42I . You are receiving this because you commented.Message ID: @.***>

chrsBlank commented 1 year ago

Sorry for repling so late and thank you a lot for your time.

No i dont think so, before googling it i didnt even know what it was sadly. Should i add something like that?

chrsBlank commented 1 year ago

should i put this?

!/usr/bin/env python3

bugy commented 1 year ago

Yes, please do it. Otherwise Linux won't know how to execute the script

YasTouchedMySpaggett @.***> schrieb am So., 27. Nov. 2022, 18:32:

should i put this?

!/usr/bin/env python3

— Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/598#issuecomment-1328300975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJXPJN5J3UTF7BVMZ5EFP3WKOLJXANCNFSM6AAAAAASMNR42I . You are receiving this because you commented.Message ID: @.***>

MNeill73 commented 1 year ago

The shebang statement specifies which interpreter should be run to parse the script.

Personally I've never seen the "env interpreter" syntax before very recently. Historically, it's /path/to/interpreter, so, /bin/bash (because I always invoke the statically-linked version of shells), or /usr/bin/python27 (specific python version), or /usr/bin/python (to invoke the "current" python interpreter by way of soft link).

On November 27, 2022 12:32:11 PM YasTouchedMySpaggett @.***> wrote:

should i put this?

!/usr/bin/env python3

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

chrsBlank commented 1 year ago

thanks a lot, seems to be working now, how do i install modules on the specific pyhton3? even tho my python has all the modules the "env" used by #!/usr/bin/env python3 does not have all my modules

chrsBlank commented 1 year ago

also i have it in a container, maybe i need to install the packages there? i use portainer

bugy commented 1 year ago

Yes, you need to install packages there

MNeill73 commented 1 year ago

In the container, and invoke the appropriate and specific pip to install them in the modules directory for that version (I.e. if /usr/bin/python is linked to python37, then specifically invoke pip37 instead of plain pop to make sure you have them in the python37 includes).

On November 27, 2022 12:52:35 PM Iaroslav Shepilov @.***> wrote:

Yes, you need to install packages there — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>