zyddnys / manga-image-translator

Translate manga/image 一键翻译各类图片内文字 https://cotrans.touhou.ai/
https://cotrans.touhou.ai/
GNU General Public License v3.0
5.31k stars 547 forks source link

[Bug]: ERROR: Could not build wheels for pydensecrf, which is required to install pyproject.toml-based projects #340

Open My12123 opened 1 year ago

My12123 commented 1 year ago

Issue

Installing dependencies

Command Line Arguments

pip install -r requirements.txt

Console logs

(manga-image-translator) F:\manga-image-translator>pip install -r requirements.txt
Collecting git+https://github.com/lucasb-eyer/pydensecrf.git (from -r requirements.txt (line 40))
  Cloning https://github.com/lucasb-eyer/pydensecrf.git to c:\users\tchot\appdata\local\temp\pip-req-build-ufuj_m64
  Running command git clone --filter=blob:none --quiet https://github.com/lucasb-eyer/pydensecrf.git 'C:\Users\tchot\AppData\Local\Temp\pip-req-build-ufuj_m64'
  Resolved https://github.com/lucasb-eyer/pydensecrf.git to commit 0d53acbcf5123d4c88040fe68fbb9805fc5b2fb9
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: networkx in f:\1\envs\manga-image-translator\lib\site-packages (from -r requirements.txt (line 1)) (3.0)
Requirement already satisfied: torch in f:\1\envs\manga-image-translator\lib\site-packages (from -r requirements.txt (line 2)) (2.0.1+cu118)
Requirement already satisfied: torchvision in f:\1\envs\manga-image-translator\lib\site-packages (from -r requirements.txt (line 3)) (0.15.2+cu118)
Collecting torch-summary
  Using cached torch_summary-1.4.5-py3-none-any.whl (16 kB)
Collecting einops
  Using cached einops-0.6.1-py3-none-any.whl (42 kB)
Collecting scikit-image
  Using cached scikit_image-0.20.0-cp310-cp310-win_amd64.whl (23.7 MB)
Collecting opencv-python
  Using cached opencv_python-4.7.0.72-cp37-abi3-win_amd64.whl (38.2 MB)
Collecting pyclipper
  Using cached pyclipper-1.3.0.post4-cp310-cp310-win_amd64.whl (94 kB)
Collecting shapely
  Using cached shapely-2.0.1-cp310-cp310-win_amd64.whl (1.4 MB)
Requirement already satisfied: requests in f:\1\envs\manga-image-translator\lib\site-packages (from -r requirements.txt (line 10)) (2.28.1)
Collecting oscrypto
  Using cached oscrypto-1.3.0-py2.py3-none-any.whl (194 kB)
Collecting freetype-py
  Using cached freetype_py-2.4.0-py3-none-win_amd64.whl (790 kB)
Collecting googletrans==4.0.0rc1
  Using cached googletrans-4.0.0rc1-py3-none-any.whl
Collecting aiohttp
  Using cached aiohttp-3.8.4-cp310-cp310-win_amd64.whl (319 kB)
Collecting tqdm
  Using cached tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting deepl
  Using cached deepl-1.14.0-py3-none-any.whl (39 kB)
Collecting ImageHash
  Using cached ImageHash-4.3.1-py2.py3-none-any.whl (296 kB)
Collecting kornia
  Using cached kornia-0.6.12-py2.py3-none-any.whl (653 kB)
Collecting backports.cached-property
  Using cached backports.cached_property-1.0.2-py3-none-any.whl (6.1 kB)
Collecting huggingface_hub
  Using cached huggingface_hub-0.14.1-py3-none-any.whl (224 kB)
Collecting transformers
  Using cached transformers-4.28.1-py3-none-any.whl (7.0 MB)
Collecting langid
  Using cached langid-1.1.6-py3-none-any.whl
Collecting sentencepiece
  Using cached sentencepiece-0.1.99-cp310-cp310-win_amd64.whl (977 kB)
Collecting editdistance
  Using cached editdistance-0.6.2-cp310-cp310-win_amd64.whl (22 kB)
Requirement already satisfied: numpy in f:\1\envs\manga-image-translator\lib\site-packages (from -r requirements.txt (line 25)) (1.24.3)
Collecting tensorboardX
  Using cached tensorboardX-2.6-py2.py3-none-any.whl (114 kB)
Collecting websockets
  Using cached websockets-11.0.3-cp310-cp310-win_amd64.whl (124 kB)
Collecting protobuf
  Using cached protobuf-4.22.4-cp310-abi3-win_amd64.whl (420 kB)
Collecting ctranslate2
  Using cached ctranslate2-3.13.0-cp310-cp310-win_amd64.whl (18.0 MB)
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting openai
  Using cached openai-0.27.6-py3-none-any.whl (71 kB)
Collecting open_clip_torch
  Using cached open_clip_torch-2.19.0-py3-none-any.whl (1.5 MB)
Collecting safetensors
  Using cached safetensors-0.3.1-cp310-cp310-win_amd64.whl (263 kB)
Collecting pandas
  Using cached pandas-2.0.1-cp310-cp310-win_amd64.whl (10.7 MB)
Collecting onnxruntime
  Using cached onnxruntime-1.14.1-cp310-cp310-win_amd64.whl (6.5 MB)
Collecting omegaconf
  Using cached omegaconf-2.3.0-py3-none-any.whl (79 kB)
Collecting python-dotenv
  Using cached python_dotenv-1.0.0-py3-none-any.whl (19 kB)
Collecting nest-asyncio
  Using cached nest_asyncio-1.5.6-py3-none-any.whl (5.2 kB)
Collecting marshmallow
  Using cached marshmallow-3.19.0-py3-none-any.whl (49 kB)
Collecting httpx==0.13.3
  Using cached httpx-0.13.3-py3-none-any.whl (55 kB)
Requirement already satisfied: certifi in f:\1\envs\manga-image-translator\lib\site-packages (from httpx==0.13.3->googletrans==4.0.0rc1->-r requirements.txt (line 13)) (2022.12.7)
Collecting idna==2.*
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting rfc3986<2,>=1.3
  Using cached rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
Collecting httpcore==0.9.*
  Using cached httpcore-0.9.1-py3-none-any.whl (42 kB)
Collecting chardet==3.*
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting sniffio
  Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting hstspreload
  Using cached hstspreload-2023.1.1-py3-none-any.whl (1.5 MB)
Collecting h11<0.10,>=0.8
  Using cached h11-0.9.0-py2.py3-none-any.whl (53 kB)
Collecting h2==3.*
  Using cached h2-3.2.0-py2.py3-none-any.whl (65 kB)
Collecting hyperframe<6,>=5.2.0
  Using cached hyperframe-5.2.0-py2.py3-none-any.whl (12 kB)
Collecting hpack<4,>=3.0
  Using cached hpack-3.0.0-py2.py3-none-any.whl (38 kB)
Requirement already satisfied: filelock in f:\1\envs\manga-image-translator\lib\site-packages (from torch->-r requirements.txt (line 2)) (3.9.0)
Requirement already satisfied: typing-extensions in f:\1\envs\manga-image-translator\lib\site-packages (from torch->-r requirements.txt (line 2)) (4.4.0)
Requirement already satisfied: sympy in f:\1\envs\manga-image-translator\lib\site-packages (from torch->-r requirements.txt (line 2)) (1.11.1)
Requirement already satisfied: jinja2 in f:\1\envs\manga-image-translator\lib\site-packages (from torch->-r requirements.txt (line 2)) (3.1.2)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in f:\1\envs\manga-image-translator\lib\site-packages (from torchvision->-r requirements.txt (line 3)) (9.3.0)
Collecting lazy_loader>=0.1
  Using cached lazy_loader-0.2-py3-none-any.whl (8.6 kB)
Collecting imageio>=2.4.1
  Using cached imageio-2.28.1-py3-none-any.whl (3.4 MB)
Collecting scipy>=1.8
  Using cached scipy-1.10.1-cp310-cp310-win_amd64.whl (42.5 MB)
Collecting tifffile>=2019.7.26
  Using cached tifffile-2023.4.12-py3-none-any.whl (219 kB)
Collecting packaging>=20.0
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting PyWavelets>=1.1.1
  Using cached PyWavelets-1.4.1-cp310-cp310-win_amd64.whl (4.2 MB)
Requirement already satisfied: charset-normalizer<3,>=2 in f:\1\envs\manga-image-translator\lib\site-packages (from requests->-r requirements.txt (line 10)) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in f:\1\envs\manga-image-translator\lib\site-packages (from requests->-r requirements.txt (line 10)) (1.26.13)
Collecting asn1crypto>=1.5.1
  Using cached asn1crypto-1.5.1-py2.py3-none-any.whl (105 kB)
Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.4-cp310-cp310-win_amd64.whl (28 kB)
Collecting attrs>=17.3.0
  Using cached attrs-23.1.0-py3-none-any.whl (61 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.3-cp310-cp310-win_amd64.whl (33 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.9.2-cp310-cp310-win_amd64.whl (61 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting pyyaml>=5.1
  Using cached PyYAML-6.0-cp310-cp310-win_amd64.whl (151 kB)
Collecting fsspec
  Using cached fsspec-2023.5.0-py3-none-any.whl (160 kB)
Collecting regex!=2019.12.17
  Using cached regex-2023.5.5-cp310-cp310-win_amd64.whl (267 kB)
Collecting tokenizers!=0.11.3,<0.14,>=0.11.1
  Using cached tokenizers-0.13.3-cp310-cp310-win_amd64.whl (3.5 MB)
Collecting protobuf
  Using cached protobuf-3.20.3-cp310-cp310-win_amd64.whl (904 kB)
Collecting timm
  Using cached timm-0.6.13-py3-none-any.whl (549 kB)
Collecting ftfy
  Using cached ftfy-6.1.1-py3-none-any.whl (53 kB)
Collecting pytz>=2020.1
  Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB)
Collecting tzdata>=2022.1
  Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
Collecting python-dateutil>=2.8.2
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting coloredlogs
  Using cached coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
Collecting flatbuffers
  Using cached flatbuffers-23.3.3-py2.py3-none-any.whl (26 kB)
Collecting antlr4-python3-runtime==4.9.*
  Using cached antlr4_python3_runtime-4.9.3-py3-none-any.whl
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting humanfriendly>=9.1
  Using cached humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
Collecting wcwidth>=0.2.5
  Using cached wcwidth-0.2.6-py2.py3-none-any.whl (29 kB)
Requirement already satisfied: MarkupSafe>=2.0 in f:\1\envs\manga-image-translator\lib\site-packages (from jinja2->torch->-r requirements.txt (line 2)) (2.1.2)
Requirement already satisfied: mpmath>=0.19 in f:\1\envs\manga-image-translator\lib\site-packages (from sympy->torch->-r requirements.txt (line 2)) (1.2.1)
Collecting pyreadline3
  Using cached pyreadline3-3.4.1-py3-none-any.whl (95 kB)
Building wheels for collected packages: pydensecrf
  Building wheel for pydensecrf (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pydensecrf (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\pydensecrf
      copying pydensecrf\utils.py -> build\lib.win-amd64-cpython-310\pydensecrf
      copying pydensecrf\__init__.py -> build\lib.win-amd64-cpython-310\pydensecrf
      running build_ext
      building 'pydensecrf.eigen' extension
      creating build\temp.win-amd64-cpython-310
      creating build\temp.win-amd64-cpython-310\Release
      creating build\temp.win-amd64-cpython-310\Release\pydensecrf
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ipydensecrf/densecrf/include -Ipydensecrf -IF:\1\envs\manga-image-translator\include -IF:\1\envs\manga-image-translator\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tppydensecrf/eigen.cpp /Fobuild\temp.win-amd64-cpython-310\Release\pydensecrf/eigen.obj
      eigen.cpp
      F:\1\envs\manga-image-translator\include\pyconfig.h(59): fatal error C1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: io.h: No such file or directory,
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pydensecrf
Failed to build pydensecrf
ERROR: Could not build wheels for pydensecrf, which is required to install pyproject.toml-based projects
JustFrederik commented 1 year ago

pydensecrf requires cython. Install it!!

My12123 commented 1 year ago

Then you need to add it to the dependencies.

JustFrederik commented 1 year ago

@My12123 its not a dependency, but the python compiler. when installing python on other operating systems it is installed by default. Windows is special, thats why you need to install it serperatly. But you only need to install it once and globally(not in a venv)