-
Notifications
You must be signed in to change notification settings - Fork 694
Recommended way to conda install pytorch, torchaudio, and ffmpeg without conflicts #3269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To avoid the conflict, can you install ffmpeg separately with the channel overridden, after creating the conda environment? Also note that the officially distributed TorchAudio binaries are not compatible with ffmpeg>5 — if compatibility is a requirement, please build TorchAudio from source (https://pytorch.org/audio/main/installation.html#optional-dependencies). |
Installing ffmpeg afterwards isn't great for me, as then I can't define my conda requirements in a single file (I'm using conda-lock for this). Thanks for the heads up about ffmpeg compatibility. I hadn't actually been aware that ffmpeg was an optional dependency of torchaudio, I'm using pyav separately and not using torchaudio.io so hopefully that won't be a problem. It sounds like for now flexible channel priority might be the best option for me. |
TorchAudio supporting FFmpeg5 is one thing I am planning to address, but the dual use of PyAV makes the thing complicated. I doubt that installing separate FFmpeg would help. PyAV uses its own FFmpeg, therefore if you try to load another FFmpeg libraries after importing PyAV, I think the application will crash due to the duplicated symbols from FFmpeg. Therefore I do not think it is really a solution to install torchaudio with supported FFmepg alongside PyAV. I think one way to work around is to build torchaudio by linking against the FFmpeg bundled with PyAV. |
We have updated the ffmpeg version to 5 in nightly build. Hopefully it will resolve in the next release. |
Thanks! |
I would like to build a linux-64 conda environment containing the following:
The following approach results in a conflict:
Because an old version of ffmpeg is available in the pytorch channel, so strict channel priority (recommended by conda https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html#strict-channel-priority) prevents using a lower priority channel.
torchaudio is not available in conda-forge so I need both channels. If I make the conda-forge channel higher priority than the pytorch channel then I end up with pytorch and torchaudio from different channels, which causes errors at runtime.
It seems like the only way to achieve this is to use flexible channel priority rather than strict, but conda discourage this and plan to make strict the default in future. Do you have any recommendations?
The text was updated successfully, but these errors were encountered: