facebookresearch / demucs

Code for the paper Hybrid Spectrogram and Waveform Source Separation
MIT License
7.94k stars 991 forks source link

Failed Installation - Fedora 37 #491

Open martinprad0 opened 1 year ago

martinprad0 commented 1 year ago

🐛 Bug Report

To reproduce:

  1. Step 1 Run on the terminal pip3 install -U demucs

Actual Behavior

Output: Defaulting to user installation because normal site-packages is not writeable Collecting demucs Using cached demucs-4.0.0-py3-none-any.whl Requirement already satisfied: dora-search in ./.local/lib/python3.11/site-packages (from demucs) (0.1.11) . . .

Requirement already satisfied: cloudpickle>=1.2.1 in ./.local/lib/python3.11/site-packages (from submitit->dora-search->demucs) (2.2.1) Requirement already satisfied: mpmath>=0.19 in ./.local/lib/python3.11/site-packages (from sympy->torch>=1.8.1->demucs) (1.3.0) Building wheels for collected packages: diffq Building wheel for diffq (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for diffq (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [33 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-311 creating build/lib.linux-x86_64-cpython-311/diffq copying diffq/utils.py -> build/lib.linux-x86_64-cpython-311/diffq copying diffq/uniform.py -> build/lib.linux-x86_64-cpython-311/diffq copying diffq/ts_export.py -> build/lib.linux-x86_64-cpython-311/diffq copying diffq/torch_pack.py -> build/lib.linux-x86_64-cpython-311/diffq copying diffq/lsq.py -> build/lib.linux-x86_64-cpython-311/diffq copying diffq/diffq.py -> build/lib.linux-x86_64-cpython-311/diffq copying diffq/base.py -> build/lib.linux-x86_64-cpython-311/diffq copying diffq/init.py -> build/lib.linux-x86_64-cpython-311/diffq running egg_info writing diffq.egg-info/PKG-INFO writing dependency_links to diffq.egg-info/dependency_links.txt writing requirements to diffq.egg-info/requires.txt writing top-level names to diffq.egg-info/top_level.txt reading manifest file 'diffq.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching 'examples/cifar/outputs/**' adding license file 'LICENSE' writing manifest file 'diffq.egg-info/SOURCES.txt' running build_ext building 'diffq.bitpack' extension creating build/temp.linux-x86_64-cpython-311 gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.11 -c bitpack.c -o build/temp.linux-x86_64-cpython-311/bitpack.o bitpack.c:19:10: fatal error: Python.h: No such file or directory 19 | #include "Python.h" | ^~~~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for diffq Failed to build diffq ERROR: Could not build wheels for diffq, which is required to install pyproject.toml-based projects

(Write what happened. Add screenshots, if applicable.)

Your Environment

CarlGao4 commented 1 year ago

Please try reinstalling Python with your package manager

TheSrBig commented 12 months ago

how?

CarlGao4 commented 12 months ago

Using conda environment is suggested.

CarlGao4 commented 12 months ago

Visit docs for Linux and I've copied the related contents here:

I recommend installing Miniconda, with Python 3.8 or more.

conda activate
pip3 install -U demucs
# Then anytime you want to use demucs, first do conda activate, then
demucs -d cpu PATH_TO_AUDIO_FILE_1

Of course, you can also use a specific env for Demucs.

Important, torchaudio 0.12 update: Torchaudio no longer supports decoding mp3s without ffmpeg installed. You must have ffmpeg installed, either through Anaconda (conda install ffmpeg -c conda-forge) or as a distribution package (e.g. sudo apt-get install ffmpeg).