unilm icon indicating copy to clipboard operation
unilm copied to clipboard

ERROR in TROCR installation

Open shenw000 opened this issue 2 years ago • 1 comments

To install trocr on Ubuntu 20.04, I followed the trocr installation steps on https://github.com/microsoft/unilm/tree/master/trocr

conda create -n trocr python=3.7 conda activate trocr git clone https://github.com/microsoft/unilm.git cd unilm cd trocr pip install pybind11 pip install -r requirements.txt pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" 'git+https://github.com/NVIDIA/apex.git'

Every goes well until I ran the installation script of trocr, pip install -r requirements.txt I encountered the following error

======================================================================== INFO: pip is looking at multiple versions of fastwer to determine which version is compatible with other requirements. This could take a while. Collecting fastwer Using cached fastwer-0.1.tar.gz (3.6 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 36, in File "", line 34, in File "/tmp/pip-install-p201j4px/fastwer_063feafc5a6f4f29a4b5e94054f4c21a/setup.py", line 93, in with open('LICENSE') as f: FileNotFoundError: [Errno 2] No such file or directory: 'LICENSE' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

========================================================================

I searched the Internet for possible solutions, but didn't see any. I did upgraded the pip to version 22.1.2

shenw000 avatar Jul 04 '22 14:07 shenw000

As a temporary hotfix you can

  • install a newer version of fastwer (I had no issues with 0.1.3)
  • remove the specific version from pytorch, torchvision and timm in the requirements.txt

I was able to at least pull and set up the environment

(if anyone wants to use it under windows: Open the PowerShell as root, or just use WSL with an up-to-date gcc version) EDIT: No need to use an older checkout of fairseq

dka-lmis avatar Jul 11 '22 21:07 dka-lmis

Hi, @dka-lmis, I know it's been over a year. I hope it's still relevant to you 😃 I did as you suggested, but still the same error occured. Could you please share your requirements.txt file for reference?

Right now, I am trying to install the dependencies one by one, so it would also be great to know what versions of dependencies you got over there. Thank you!

bit-scientist avatar Aug 03 '23 03:08 bit-scientist

https://wiki.python.org/moin/WindowsCompilers watch this and download then solved

haojianqi1 avatar Oct 01 '23 08:10 haojianqi1