ostris / ai-toolkit

Various AI scripts. Mostly Stable Diffusion stuff.
MIT License
3.35k stars 350 forks source link

ImportError: cannot import name 'packaging' from 'pkg_resources' #40

Closed Anibaaal closed 2 months ago

Anibaaal commented 3 months ago

I set up everything according to the Readme and this guide video https://www.youtube.com/watch?v=HzGW_Kyermg, but I'm getting this error after a reinstall because dotenv failed to install the first time:

Running 1 job Error running job: cannot import name 'packaging' from 'pkg_resources' (C:\StableDiffusion\Training\ai-toolkit\venv\Lib\site-packages\pkg_resources__init__.py)

======================================== Result:

Anibaaal commented 3 months ago

Solved by replacing line 6 in ai-toolkit\venv\Lib\site-packages\clip\clip.py from from 'pkg_resources import packaging' to 'import packaging' as suggested here https://github.com/pytorch/serve/issues/3176

etha302 commented 3 months ago

Solved by replacing line 6 in ai-toolkit\venv\Lib\site-packages\clip\clip.py from from 'pkg_resources import packaging' to 'import packaging' as suggested here pytorch/serve#3176

thanks you saved me hours of work!

diodiogod commented 3 months ago

I solved this with gpt help by doing pip install --upgrade setuptools and then py -m pip install --upgrade pip setuptools wheel

HydraBucket commented 2 months ago

Thank you random @diodiogod , I love random Githubbers and redditors for a random tech issue. Lora is training because of you and some guy in youtube comments!

TalhaKarakoyunlu commented 3 weeks ago

thanks, fixed the issue