Search code examples
pythonwindowspyffmpeg

python packages with dependencies in windows system


I am trying to work with python on a new project in my windows system. The project uses ffmpeg and pyrabin among others. I find it extremely difficult to move forward with pip installing these packages as they constantly keep on asking for missing dependencies. Following are some errors:

ffvideo\ffvideo.c(254) : fatal error C1083: Cannot open include file: 'libavutil/rational.h': No such file or directory

local\temp\pip-build-kvsijc\pyrabin\src\rabin_polynomial.h(38) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory

It is taking me forever to resolve each of them. Please advice on how to quickly resolve such missing dependencies. I tried google and it is full of options for linux systems. Any help would be highly appreciated.


Solution

  • You're basically asking how to quickly set up a development environment to compile a given project. You're generally at the mercy of the project developers and how well they documented the build process.

    On linux, you often have a package manager to make the installing and resolving of dependencies easy.

    Since Windows doesn't have a package manager, many popular projects with lots of dependencies will include a download link to a Libraries zip file that contains all the dependencies necessary to compile the source.

    Instead of running pip each time, it may be faster to just download the source to those python projects and run the setup.py manually, resolving dependencies until it succeeds.

    In general, for python libraries that wrap C/C++ libraries, you're not going to be able to build the python library if you can't build the corresponding C/C++ library. So, you may want to download the ffmpeg source and try compiling it first.

    Also, for some compiled python libraries, you may be able to find python wheels, which will contain pre-compiled binaries for your system, making the compile step unnecessary. If the python library wraps another C/C++ library, you'll still need to download and install the appropriate version of the library that it wraps (e.g. ffmpeg)