KichangKim / DeepDanbooru

AI based multi-label girl image classification system, implemented by using TensorFlow.
MIT License
2.6k stars 259 forks source link

Error when trying to install Hydrus-dd #49

Closed WorldTeacher closed 2 years ago

WorldTeacher commented 2 years ago

I tried installing hydrus-dd, which uses DeepDanbooru and I got the following error: ` ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1ddf0il/deepdanbooru/setup.py'"'"'; file='"'"'/tmp/pip-install-1ddf0il/deepdanbooru/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egginfo --egg-base /tmp/pip-install-1ddf0il/deepdanbooru/pip-egg-info cwd: /tmp/pip-install-1ddf0il/deepdanbooru/ Complete output (5 lines): Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-1ddf0il/deepdanbooru/setup.py", line 12, in version = re.search("version = '([^']+)'", f.read()).group(1) # type: ignore AttributeError: 'NoneType' object has no attribute 'group'

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. `

WorldTeacher commented 2 years ago

the Issue seems to be in this line in setup.py: Image Edit: in order to manually Install deepdanbooru I manually commented out lines 11 and 12 and added version="1.0.0" to line 13

rachmadaniHaryono commented 2 years ago

it is caused by this commit https://github.com/KichangKim/DeepDanbooru/commit/c9bbfb0ab6e6027607b3b2fc80c1ae9ca32ce7b5

especially this line https://github.com/KichangKim/DeepDanbooru/commit/c9bbfb0ab6e6027607b3b2fc80c1ae9ca32ce7b5#diff-57ea504dee22088ee4f6f647f65bd14d050760a003882d20aaede488f52c5306R7

other than what you recommended, you can also change the regex used on setup

https://github.com/KichangKim/DeepDanbooru/blob/c9bbfb0ab6e6027607b3b2fc80c1ae9ca32ce7b5/setup.py#L12

    version = re.search('__version__ = "([^"]+)', f.read()).group(1)  # type: ignore

e: wrong quote character

KichangKim commented 2 years ago

Black formatter makes all single quote to double quote. I fixed it (https://github.com/KichangKim/DeepDanbooru/commit/92ba0b56be5eed0037e3f067bb9867f5ac691647)