kkroening / ffmpeg-python

Python bindings for FFmpeg - with complex filtering support
Apache License 2.0
9.81k stars 880 forks source link

Can't import in DCC software #130

Open mathbou opened 5 years ago

mathbou commented 5 years ago

I'm developing tools on Maya and 3dsMax but I get an error when I import ffmpeg lib. Those two softwares are still on python 2.7 and uses a zipped version of it.

Error: IOError: file C:\Program Files\Autodesk\Maya2018\bin\python27.zip\lib2to3\pgen2\pgen.py line 15: 2 #

After digging into the lib it seems the line from past.builtins import basestring is causing the problem. I made a try by removing every occurrences of it and it looks like it works.

kkroening commented 5 years ago

Any idea what the exact version of python bundled in Maya is? (I don't have a copy of Maya to check)

And how are you going about installing ffmpeg-python into that python environment? ffmpeg-python depends on the future package, which normally gets installed automatically if you do pip install ffmpeg. If you're installing it through some other means though then that step could be getting skipped.

FWIW, we do test against Python 2.7: (travis)

mathbou commented 5 years ago

The exact version in Maya 2018 is 2.7.11. I used pip to install it and then I overrided the PYTHONPATH variable by adding my local site-packages folder.

As I said above, the lib works in Maya if I remove the import occurences of past.builtins, and it passed all of the tests with a 2.7 environment. So is this import still usefull ?