Skip to content
Advertisement

Moviepy OSError Exec format error – Missing Shebang?

I am attempting to use MoviePy with Python 3.2.3 on Raspian. I have installed it (for Python 2.7, 3.2 and 3.5… long story) and the line

JavaScript

works fine. When I try

JavaScript

which is the most basic command, it gives the error

JavaScript

I have researched this error, and it appears to be something to do with a shebang line missing somewhere. Is this correct, if so, how do I go about finding where it is missing, and what do I add? Thanks

Edit: As per cxw’s comment, I installed moviepy using the command

JavaScript

(I may have used ‘sudo’ as well)

FFMPEG was supposed to download automatically when I first used moviepy:

MoviePy depends on the software FFMPEG for video reading and writing. > You don’t need to worry about that, as FFMPEG should be automatically > downloaded/installed by ImageIO during your first use of MoviePy (it takes a few seconds). If you want to use a specific version of FFMPEG, follow the instructions in file config_defaults.py.

[Quote from installation guide here]

Advertisement

Answer

Manually download ffmpeg, then before running your Python code, do

JavaScript

at the shell/terminal prompt.

As far as I can tell from the source, the automatic download of ffmpeg does not know about Raspberry Pis. The auto-download code pulls from the imageio github repo, which only knows “linux32” vs. “linux64”. It doesn’t look like it has an ARM-linux option. When the ARM kernel sees a non-ARM image, it throws the error you see.

Rather than using the environment variable, you can edit your moviepy config-defaults.py file to specify FFMPEG_BINARY = r"/path/to/ffmpeg".

Edit to find the path/to/ffmpeg after installing it with apt-get, do

JavaScript

at the shell/terminal prompt. It will probably be in /bin or /usr/bin, and will probably be called ffmpeg or ffmpeg-x.xx (with some version number).
Thanks to this answer for dpkg

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement