Open YoungPhlo opened 5 months ago
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:
- https://github.com/pypa/setuptools/issues/4376
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'
.- https://github.com/pypa/setuptools/issues/4376#issuecomment-2123274240
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.- https://github.com/pypa/setuptools/issues/4385
- https://github.com/pypa/setuptools/issues/4385#issuecomment-2126286321
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:
- continue to use an older version of
setuptools
as a workaround/hack to make the existing code work (not recommended)
- See the quoted 'fix' above
- update the code + install the relevant packages yourself (recommended)
- Use the solution @Abhijitjimmi provided above in https://github.com/Stability-AI/stable-audio-tools/issues/74#issuecomment-2159267427:
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
Originally posted by @0xdevalias in https://github.com/Stability-AI/stable-audio-tools/issues/74#issuecomment-2164143964
After installing OpenAI's clip it works
pip install git+https://github.com/openai/CLIP.git
Traceback:
They're having the same issue over on https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/15863
Something about the
setuptools==70.0.0
release brokepkg_resources
and it looks like there are no plans to fix it... Not sure where that leavesclip
The command that worked for me is
python -m pip install setuptools==69.5.1
(with the
stable-audio-tools
venv activated)I can run
python run_gradio.py
plus arguments and it works after downgrading.