TareHimself/manga-translator

I recieve this error when running poetry install

Cunpa opened this issue · 8 comments

Cunpa commented

(manga-translator) F:\manga-translator>poetry install
Updating dependencies
Resolving dependencies...

Package operations: 96 installs, 5 updates, 0 removals

Installing pyasn1 (0.5.0)
Installing cachetools (5.3.1)
Updating certifi (2023.7.22 -> 2022.12.7)
Updating idna (3.4 -> 2.10)
Installing markupsafe (2.1.3)
Installing mpmath (1.3.0)
Installing numpy (1.25.2)
Installing protobuf (4.24.0)
Installing pyasn1-modules (0.3.0)
Installing rsa (4.9)
Updating urllib3 (1.26.16 -> 2.0.4)
Installing contourpy (1.1.0)
Installing cycler (0.10.0)
Installing google-auth (2.17.3)
Installing fonttools (4.42.0)
Installing googleapis-common-protos (1.60.0)
Installing kiwisolver (1.4.4)
Installing pillow (9.5.0)
Installing pyparsing (2.4.7)
Installing fsspec (2023.6.0)
Installing grpcio (1.57.0)
Installing python-dateutil (2.8.2)
Installing jinja2 (3.1.2)
Installing importlib-resources (6.0.1)
Installing networkx (3.1)
Installing pyyaml (6.0.1)
Installing pytz (2023.3)
Installing sympy (1.12)
Installing tqdm (4.66.1)
Installing typing-extensions (4.7.1)
Installing tzdata (2023.3)
Installing google-api-core (2.11.1)
Installing grpcio-status (1.57.0)
Installing imageio (2.31.1)
Installing huggingface-hub (0.16.4)
Installing lazy-loader (0.3)
Installing opencv-python (4.8.0.76)
Installing matplotlib (3.7.2)
Installing regex (2023.8.8)
Installing pywavelets (1.4.1)
Installing llvmlite (0.34.0)
Installing tifffile (2023.8.12)
Installing termcolor (2.3.0)
Installing scipy (1.9.3)
Installing safetensors (0.3.2)
Updating setuptools (68.0.0 -> 68.1.0)
Installing pandas (2.0.3)
Installing tokenizers (0.13.3)
Installing torch (2.0.1)
Installing win32-setctime (1.1.0)

ChefBuildError

Backend subprocess exited when trying to invoke build_wheel

running bdist_wheel
C:\Users\Cunpa\AppData\Local\Temp\tmp0cz5a7s5.venv\Scripts\python.exe C:\User
s\Cunpa\AppData\Local\Temp\tmpxng_mpe1\llvmlite-0.34.0\ffi\build.py
Trying generator 'Visual Studio 15 2017 Win64'
Traceback (most recent call last):
File "C:\Users\Cunpa\AppData\Local\Temp\tmpxng_mpe1\llvmlite-0.34.0\ffi\buil
d.py", line 191, in
main()
File "C:\Users\Cunpa\AppData\Local\Temp\tmpxng_mpe1\llvmlite-0.34.0\ffi\buil
d.py", line 179, in main
main_win32()
File "C:\Users\Cunpa\AppData\Local\Temp\tmpxng_mpe1\llvmlite-0.34.0\ffi\buil
d.py", line 88, in main_win32
generator = find_win32_generator()
File "C:\Users\Cunpa\AppData\Local\Temp\tmpxng_mpe1\llvmlite-0.34.0\ffi\buil
d.py", line 76, in find_win32_generator
try_cmake(cmake_dir, build_dir, generator)
File "C:\Users\Cunpa\AppData\Local\Temp\tmpxng_mpe1\llvmlite-0.34.0\ffi\buil
d.py", line 28, in try_cmake
subprocess.check_call(['cmake', '-G', generator, cmake_dir])
File "C:\ProgramData\anaconda3\envs\manga-translator\lib\subprocess.py", lin
e 368, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\ProgramData\anaconda3\envs\manga-translator\lib\subprocess.py", lin
e 349, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\ProgramData\anaconda3\envs\manga-translator\lib\subprocess.py", lin
e 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\ProgramData\anaconda3\envs\manga-translator\lib\subprocess.py", lin
e 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
error: command 'C:\Users\Cunpa\AppData\Local\Temp\tmp0cz5a7s5\.venv\Sc
ripts\python.exe' failed with exit code 1

at C:\ProgramData\anaconda3\envs\manga-translator\lib\site-packages\poetry\ins
tallation\chef.py:147 in _prepare
143│
144│ error = ChefBuildError("\n\n".join(message_parts))
145│
146│ if error is not None:
→ 147│ raise error from None
148│
149│ return path
150│
151│ def _prepare_sdist(self, archive: Path, destination: Path | None
= None) -> Path:

Note: This error originates from the build backend, and is likely not a problem
with poetry but with llvmlite (0.34.0) not supporting PEP 517 builds. You can ve
rify this by running 'pip wheel --use-pep517 "llvmlite (==0.34.0)"'.

Looks like it could be the same issue here numba/llvmlite#621 can you try running

pip --version

Also what os are you on ?

Also pull again and run poe install-deps to install dependencies

Cunpa commented

Edit: I forgot to mention that whatever you changed last night and running poe install-deps fixed the llvm error.
I'm running windows 8.1. This is what pip versio

(manga-translator) F:\manga-translator>pip --version
pip 23.2.1 from C:\ProgramData\anaconda3\envs\manga-translator\lib\site-packages
\pip (python 3.9)

Cunpa commented

(manga-translator3) F:\manga-translator>python main.py -m convert -f "C:\Users\C
unpa\Desktop\1.jpg"
Traceback (most recent call last):
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\site-packages\pytess
eract\pytesseract.py", line 388, in get_tesseract_version
output = subprocess.check_output(
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\manga-translator\translator\core\ocr.py", line 204, in is_valid
pytesseract.get_tesseract_version()
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\site-packages\pytess
eract\pytesseract.py", line 146, in wrapper
wrapper._result = func(*args, **kwargs)
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\site-packages\pytess
eract\pytesseract.py", line 395, in get_tesseract_version
raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: C:\Program Files\Tesseract-OCR\t
esseract.exe is not installed or it's not in your PATH. See README file for more
information.
Traceback (most recent call last):
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\site-packages\pytess
eract\pytesseract.py", line 388, in get_tesseract_version
output = subprocess.check_output(
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\subprocess.py", line
1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\manga-translator\translator\core\ocr.py", line 204, in is_valid
pytesseract.get_tesseract_version()
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\site-packages\pytess
eract\pytesseract.py", line 146, in wrapper
wrapper._result = func(*args, **kwargs)
File "C:\ProgramData\anaconda3\envs\manga-translator3\lib\site-packages\pytess
eract\pytesseract.py", line 395, in get_tesseract_version
raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: C:\Program Files\Tesseract-OCR\t
esseract.exe is not installed or it's not in your PATH. See README file for more
information.
Converted Batch 1/1
1_converted

(I included the output image I got)

Crazzzzzyyyy image you got there. I suggest using the UI to translate since it is easier to use. The error is because you do not have pytesseract installed, but unless you plan to use the translator, it is unnecessary. Also, I updated the color_detection model weights so don't forget to re-download that.

Cunpa commented

I installed tesseract and there are no more errors, but the speech bubbles all say "Sample" instead of translating the text. I was planning on translating at least 60,000 images so I though using CLI would be easier.

(Output)
(manga-translator3) F:\manga-translator>python main.py -m convert -f "C:\Users\C
unpa\Desktop\1.jpg"
Converted Batch 1/1

1.jpg (Input image)
1

1_converted.jpg (Output image)
1_converted

oh then if you run

python main.py -h

It will display the help message for the cli. It says "sample" because you have not selected an ocr and/or translator class. and for 60K I would suggest using the server/main.py as a reference and writing your own file to handle that as I believe the folder option for the cli translates 4 images per batch
This should be the result from the help message

usage: Manga Translator [-h] -m {live,convert} [-f FILES [FILES ...]] [-o OCR] [-oa OCR_ARGS] [-t TRA] [-ta TRA_ARGS]

Translates Manga Chapters

optional arguments:
  -h, --help            show this help message and exit
  -m {live,convert}, --mode {live,convert}
                        What mode to run
  -f FILES [FILES ...], --files FILES [FILES ...]
                        A list of images to convert or path to a folder of images
  -o OCR, --ocr OCR     Set the index of the ocr class to use. must be one of the following
                        0) BaseOcr => Always outputs "Sample"
                        1) CleanOcr => Cleans The Image i.e. does nothing
                        2) MangaOcr => Only Supports Japanese
                        3) EasyOcr => Supports all the languages listed
                        4) TesseractOcr => Supports all the languages listed
  -oa OCR_ARGS, --ocr-args OCR_ARGS
                        Set ocr class args i.e. 'key=value , key2=value'
  -t TRA, --tra TRA     Set the index of the translator class to use. must be one of the following
                        0) Translator => Base Class for all Translator classes
                        1) DeepLTranslator => The Best but it requires an auth token from here https://www.deepl.com/translator
                        2) GoogleTranslateTranslator => Translates using Google Translate
                        3) HuggingFace => Translates using hugging face models
                        4) DebugTranslator => Writes the specified text
  -ta TRA_ARGS, --tra-args TRA_ARGS
                        Set translator class args i.e. 'key=value , key2=value'
                        ```
Cunpa commented

Thank you for the help. I'm not sure why I didn't try typing -h to bring up the help menu, that's my bad. Once I added the ocr and the translator classes, everything ran perfectly.