toshiaki1729 / dataset-tag-editor-standalone

WebUI to edit dataset captions for txt2img models
MIT License
132 stars 15 forks source link

ModuleNotFoundError: No module named 'PIL' #3

Closed ride5k closed 1 year ago

ride5k commented 1 year ago

disclaimer: i am no python programmer, just a noob stumbling along. any help appreciated!

windows AMD user (directml)

cloned repo: git clone https://github.com/toshiaki1729/dataset-tag-editor-standalone.git

installed via CLI: python -m venv --system-site-packages venv .\venv\Scripts\activate pip install -r requirements.txt

launch_user.bat: venv "T:\tageditor\dataset-tag-editor-standalone\venv\Scripts\Python.exe" Traceback (most recent call last): File "T:\tageditor\dataset-tag-editor-standalone\scripts\launch.py", line 12, in import gradio as gr File "T:\tageditor\dataset-tag-editor-standalone\venv\lib\site-packages\gradio__init.py", line 3, in import gradio.components as components File "T:\tageditor\dataset-tag-editor-standalone\venv\lib\site-packages\gradio\components.py", line 22, in import matplotlib.figure File "T:\tageditor\dataset-tag-editor-standalone\venv\lib\site-packages\matplotlib\init__.py", line 148, in from . import _api, _version, cbook, _docstring, rcsetup File "T:\tageditor\dataset-tag-editor-standalone\venv\lib\site-packages\matplotlib\rcsetup.py", line 27, in from matplotlib.colors import Colormap, is_color_like File "T:\tageditor\dataset-tag-editor-standalone\venv\lib\site-packages\matplotlib\colors.py", line 51, in from PIL import Image ModuleNotFoundError: No module named 'PIL'

toshiaki1729 commented 1 year ago

PIL is pillow and you may can fix it with following commands;

.\venv\Scripts\activate
pip install pillow

But pillow is listed in requirements.txt… its weird.

ride5k commented 1 year ago

T:\tageditor\dataset-tag-editor-standalone>.\venv\Scripts\activate

(venv) T:\tageditor\dataset-tag-editor-standalone>pip install pillow Requirement already satisfied: pillow in c:\users\XXXXXXX\appdata\local\programs\python\python310\lib\site-packages (9.4.0)

however, same result as above

toshiaki1729 commented 1 year ago

I'm not sure but re-creating venv without --system-site-packages option can fix, maybe . It increases storage size though. You will need PyTorch (and directml-pytorch if needed) installed in the venv.

toshiaki1729 commented 1 year ago

or the issue is caused by the bat file? i changed it to simply call activate bat file in the latest commit

Vigilence commented 1 year ago

I would delete the entire folder and try cloning it again, this is what fixed my issue.