Open w84death opened 3 months ago
The issue is with your systems compatibility with the package flash_atn
If it can’t build the wheel it means something is not compatible. On windows, WSL uses Ubuntu which should fix the issue, but I haven’t worked on windows 10 just windows 11 which uses WSL2. You should be looking into flash_attn tho and compatibility with your system.
You could also check how NanoCoder installed flash-attn mentioned at the end of this post
I'm also getting this issue trying to install on Windows in a venv. I've tried switching to multiple version of packaging and setuptools, but just can't find the key to installing it. Also having a bunch of issues trying to install stable-audio-tools on Google Colab, getting multiple conflicts like numpy, argparse, protobuf, cuda, etc. Then it needs to restart session, which I do and try installing again, but it still doesn't work, asking to restart again. Hate dealing with versioning conflicts, especially when trying to integrate in an existing project that has many other pinned dependencies with packages we have no control over..
@hushaudio thanks! unfortunately I ran into same problem in the end.
I'm also getting this issue trying to install on Windows in a venv. I've tried switching to multiple version of packaging and setuptools, but just can't find the key to installing it.
Also having a bunch of issues trying to install stable-audio-tools on Google Colab, getting multiple conflicts like numpy, argparse, protobuf, cuda, etc. Then it needs to restart session, which I do and try installing again, but it still doesn't work, asking to restart again. Hate dealing with versioning conflicts, especially when trying to integrate in an existing project that has many other pinned dependencies with packages we have no control over..
You can use a venv in google colab and this will get rid of the issues you have there. Miniconda works fine for me. The setup is marginally longer but not a big deal.
As for the flash attention, this library has specific hardware requirements, it will give errors if your hardware does not support flash attention. I have seen some cases where the code designed to pickup the hardware (GPU) version and deal with flash attention initialisation does not work. I have made a temporary workaround by forcing flash attention off in the checks. I suspect the driver version reports are also linked to cuda versions and this is why the detection does not always report correctly, but I have not had time to check this.
A temporary hack is to search the flash attention initialisation and force it off. Alternatively some research into version reporting is needed to make this more reliable.
You will find that on later hardware you will not have this issue.
edit the line with this import packaging its no more from pkg_resources
I get the same error message on Windows 11 with Python 3.12.4, using a clean venv with setuptools downgraded to 69.5.1. Where should I edit the import packaging line?
EDIT: Works when I use Python 3.8.10 instead with downgraded setuptools, but I would prefer to use the latest versions. And CUDA is not found (yet), but this is offtopic...
You could also check how NanoCoder installed flash-attn mentioned at the end of this post
The relevant part seems to be related to setuptools
:
Thanks! a clean env solved it.
On a clean env, I additionally had to install
# ..snip.. # for packaging error `cannot import name 'packaging' from 'pkg_resources'` pip install -U packaging pip install setuptools==69.5.1 # ..snip..
Originally posted by @NanoCode012 in https://github.com/Stability-AI/stable-audio-tools/issues/73#issuecomment-2151566689
Following from that, to the official setuptools
GitHub repo, and searching for the error there, leads me to issues such as these:
69.5.1
hadpackaging.pkg_resources
. I can runfrom pkg_resources import packaging
.But
70.0.0
seems to removepackaging.pkg_resources
. Runningfrom pkg_resources import packaging
errors withImportError: cannot import name 'packaging' from 'pkg_resources'
.
The fact that users were trying to run
from pkg_resources import packaging
, means that they were relying on a side-effect/implementation detail ofpkg_resources
, and that is not guaranteed to be stable between releases.
Tl;DR: the package you are using was relying on an internal implementation detail of pkg_resources and that implementation detail was not part of the public API.
I recommend contacting the maintainers of that package and reporting the bug on their end. The easiest way to fix this is to install and import packaging directly.
So as I read that, the solutions are either to:
setuptools
as a workaround/hack to make the existing code work (not recommended)
edit the line with this
import packaging
its no more
from pkg_resources
Originally posted by @Abhijitjimmi in https://github.com/Stability-AI/stable-audio-tools/issues/74#issuecomment-2159267427
Same error on:
Both using venv.