Error during stable_audio_tools pip install "No module named 'packaging'"?

#5
by mnemic - opened
(venv) C:\AI\StableAudio>pip install -r requirements1.txt
Looking in indexes: https://download.pytorch.org/whl/cu121
Collecting torch (from -r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/cu121/torch-2.3.1%2Bcu121-cp312-cp312-win_amd64.whl (2423.5 MB)
Collecting torchvision (from -r requirements1.txt (line 3))
  Using cached https://download.pytorch.org/whl/cu121/torchvision-0.18.1%2Bcu121-cp312-cp312-win_amd64.whl (5.7 MB)
Collecting torchaudio (from -r requirements1.txt (line 4))
  Using cached https://download.pytorch.org/whl/cu121/torchaudio-2.3.1%2Bcu121-cp312-cp312-win_amd64.whl (4.1 MB)
Collecting filelock (from torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/filelock-3.13.1-py3-none-any.whl (11 kB)
Collecting typing-extensions>=4.8.0 (from torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Collecting sympy (from torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/sympy-1.12-py3-none-any.whl (5.7 MB)
Collecting networkx (from torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/networkx-3.2.1-py3-none-any.whl (1.6 MB)
Collecting jinja2 (from torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/Jinja2-3.1.3-py3-none-any.whl (133 kB)
Collecting fsspec (from torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/fsspec-2024.2.0-py3-none-any.whl (170 kB)
Collecting mkl<=2021.4.0,>=2021.1.1 (from torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/mkl-2021.4.0-py2.py3-none-win_amd64.whl (228.5 MB)
Collecting numpy (from torchvision->-r requirements1.txt (line 3))
  Using cached https://download.pytorch.org/whl/numpy-1.26.3-cp312-cp312-win_amd64.whl (15.5 MB)
Collecting pillow!=8.3.*,>=5.3.0 (from torchvision->-r requirements1.txt (line 3))
  Using cached https://download.pytorch.org/whl/pillow-10.2.0-cp312-cp312-win_amd64.whl (2.6 MB)
Collecting intel-openmp==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/intel_openmp-2021.4.0-py2.py3-none-win_amd64.whl (3.5 MB)
Collecting tbb==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/tbb-2021.11.0-py3-none-win_amd64.whl (298 kB)
Collecting MarkupSafe>=2.0 (from jinja2->torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl (17 kB)
Collecting mpmath>=0.19 (from sympy->torch->-r requirements1.txt (line 2))
  Using cached https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: tbb, mpmath, intel-openmp, typing-extensions, sympy, pillow, numpy, networkx, mkl, MarkupSafe, fsspec, filelock, jinja2, torch, torchvision, torchaudio
Successfully installed MarkupSafe-2.1.5 filelock-3.13.1 fsspec-2024.2.0 intel-openmp-2021.4.0 jinja2-3.1.3 mkl-2021.4.0 mpmath-1.3.0 networkx-3.2.1 numpy-1.26.3 pillow-10.2.0 sympy-1.12 tbb-2021.11.0 torch-2.3.1+cu121 torchaudio-2.3.1+cu121 torchvision-0.18.1+cu121 typing-extensions-4.9.0

(venv) C:\AI\StableAudio>pip install -r requirements2.txt
Collecting einops (from -r requirements2.txt (line 1))
  Using cached einops-0.8.0-py3-none-any.whl.metadata (12 kB)
Collecting ninja (from -r requirements2.txt (line 2))
  Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl.metadata (5.4 kB)
Collecting packaging (from -r requirements2.txt (line 3))
  Using cached packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
Collecting huggingface_hub (from -r requirements2.txt (line 4))
  Using cached huggingface_hub-0.23.3-py3-none-any.whl.metadata (12 kB)
Collecting stable_audio_tools (from -r requirements2.txt (line 5))
  Using cached stable_audio_tools-0.0.16-py3-none-any.whl.metadata (1.3 kB)
Requirement already satisfied: filelock in c:\ai\stableaudio\venv\lib\site-packages (from huggingface_hub->-r requirements2.txt (line 4)) (3.13.1)
Requirement already satisfied: fsspec>=2023.5.0 in c:\ai\stableaudio\venv\lib\site-packages (from huggingface_hub->-r requirements2.txt (line 4)) (2024.2.0)
Collecting pyyaml>=5.1 (from huggingface_hub->-r requirements2.txt (line 4))
  Using cached PyYAML-6.0.1-cp312-cp312-win_amd64.whl.metadata (2.1 kB)
Collecting requests (from huggingface_hub->-r requirements2.txt (line 4))
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting tqdm>=4.42.1 (from huggingface_hub->-r requirements2.txt (line 4))
  Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\ai\stableaudio\venv\lib\site-packages (from huggingface_hub->-r requirements2.txt (line 4)) (4.9.0)
Collecting aeiou==0.0.20 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached aeiou-0.0.20-py3-none-any.whl.metadata (3.6 kB)
Collecting alias-free-torch==0.0.6 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached alias_free_torch-0.0.6-py3-none-any.whl.metadata (3.8 kB)
Collecting auraloss==0.4.0 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached auraloss-0.4.0-py3-none-any.whl.metadata (8.0 kB)
Collecting descript-audio-codec==1.0.0 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached descript_audio_codec-1.0.0-py3-none-any.whl.metadata (7.8 kB)
Collecting einops (from -r requirements2.txt (line 1))
  Using cached einops-0.7.0-py3-none-any.whl.metadata (13 kB)
Collecting einops-exts==0.0.4 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached einops_exts-0.0.4-py3-none-any.whl.metadata (621 bytes)
Collecting ema-pytorch==0.2.3 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached ema_pytorch-0.2.3-py3-none-any.whl.metadata (693 bytes)
Collecting encodec==0.1.1 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached encodec-0.1.1.tar.gz (3.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting gradio>=3.42.0 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached gradio-4.33.0-py3-none-any.whl.metadata (15 kB)
Collecting importlib-resources==5.12.0 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached importlib_resources-5.12.0-py3-none-any.whl.metadata (4.1 kB)
Collecting k-diffusion==0.1.1 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached k_diffusion-0.1.1-py3-none-any.whl.metadata (3.9 kB)
Collecting laion-clap==1.1.4 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached laion_clap-1.1.4-py3-none-any.whl.metadata (26 kB)
Collecting local-attention==1.8.6 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached local_attention-1.8.6-py3-none-any.whl.metadata (684 bytes)
Collecting pandas==2.0.2 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached pandas-2.0.2.tar.gz (5.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
INFO: pip is looking at multiple versions of stable-audio-tools to determine which version is compatible with other requirements. This could take a while.
Collecting stable_audio_tools (from -r requirements2.txt (line 5))
  Using cached stable_audio_tools-0.0.15-py3-none-any.whl.metadata (1.3 kB)
  Using cached stable_audio_tools-0.0.14-py3-none-any.whl.metadata (1.3 kB)
  Using cached stable_audio_tools-0.0.13-py3-none-any.whl.metadata (1.4 kB)
Collecting flash-attn>=2.5.0 (from stable_audio_tools->-r requirements2.txt (line 5))
  Using cached flash_attn-2.5.9.post1.tar.gz (2.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  Γ— Getting requirements to build wheel did not run successfully.
  β”‚ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "C:\AI\StableAudio\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\AI\StableAudio\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\AI\StableAudio\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\MNeMiC\AppData\Local\Temp\pip-build-env-7mzuc7md\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\MNeMiC\AppData\Local\Temp\pip-build-env-7mzuc7md\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\MNeMiC\AppData\Local\Temp\pip-build-env-7mzuc7md\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\MNeMiC\AppData\Local\Temp\pip-build-env-7mzuc7md\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 9, in <module>
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

(venv) C:\AI\StableAudio>

Any ideas?
Packaging has been installed successfully prior to running the stable_audio_tools.

Requires python 3.8

Requires python 3.8

Ahhh, thank you!
Time to install another python version :D

docs say it should be python 3.8.10, but I have it working on the "latest" Python 3.8.19

Inference works fine on python 3.12 if you know what to change.

Steps to reproduce:
git clone https://github.com/Stability-AI/stable-audio-tools/

cd in and edit the "setup.py" file, remove the version requirements ("package==version" -> "package") for the following packages: aeiou, auraloss, descript-audio-codec, laion-clap, pedalboard, PyWavelets, sentencepiece, wandb

optionally, create a venv: python3 -m venv venv && cd venv && source/bin activate && cd ..

pip install -U packaging setuptools torch wheel cmake
pip install flash-attn --no-build-isolation
pip install .
pip install clip

I get 20 seconds whole script (10 seconds gen time) for a 47 second audio on 3090 ti

Sign up or log in to comment