0

I have a .sh file, containing a docker command, called start_deepracer_docker.sh. When I run it in the following way

subprocess.Popen([r"./start_deepracer_docker.sh"]) 

I get the error

OSError: [Errno 8] Exec format error: './start_deepracer_docker.sh'

How can I fix it?

Giuseppe Boezio
  • 101
  • 1
  • 11
  • 1
    Is the `x` bit set an the script? Does it have a shebang? – Klaus D. Jul 14 '22 at 08:47
  • This is the script docker run -t --rm --name=deepracer -p 8888:8888 -p 5000:5000 --cpus="3" --memory="6g" aicrowd/base-images:deepracer_round2_release /bin/bash – Giuseppe Boezio Jul 14 '22 at 09:00
  • I have read https://stackoverflow.com/questions/27606653/oserror-errno-8-exec-format-error but I do not understand in my command where I have to add #! – Giuseppe Boezio Jul 14 '22 at 09:05
  • 1
    You have to add the #! (shebang) at the start of the "start_deepracer_docker.sh" file with the path to your bash executable. Something like this: `#!/bin/bash` – Károly Szabó Jul 14 '22 at 10:24

0 Answers0