Unable to resolve dependencies for Python OCR library pypdfocr

I tried installing pypdfocr using the commands:

pip install pypdfocr
pip install -i https://pypi.anaconda.org/pypi/simple pypdfocr

but I constantly get an error message:

File "C:\Users\888537\AppData\Local\Temp\pip-build-b4mwr93n\evernote\setup
.py", line 6
        exec x
             ^
    SyntaxError: Missing parentheses in call to 'exec'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\888537\A
ppData\Local\Temp\pip-build-b4mwr93n\evernote\

The following is the installation log:

    [Anaconda3] C:\Users\888537>pip install -i https://pypi.anaconda.org/pypi/simple
 pypdfocr
Collecting pypdfocr
  Downloading https://pypi.anaconda.org/pypi/simple/pypdfocr/0.7.6/pypdfocr-0.7.
6.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pillow>=2.2 in d:\anac
onda3\lib\site-packages (from pypdfocr)
Requirement already satisfied (use --upgrade to upgrade): reportlab>=2.7 in d:\a
naconda3\lib\site-packages (from pypdfocr)
Collecting watchdog>=0.6.0 (from pypdfocr)
  Downloading https://pypi.anaconda.org/pypi/simple/watchdog/0.8.1/watchdog-0.8.
1.tar.gz (154kB)
    100% |################################| 163kB 52kB/s
Requirement already satisfied (use --upgrade to upgrade): pypdf2>=1.23 in d:\ana
conda3\lib\site-packages (from pypdfocr)
Collecting evernote (from pypdfocr)
  Downloading https://pypi.anaconda.org/pypi/simple/evernote/1.25.0/evernote-1.2
5.0.tar.gz (140kB)
    100% |################################| 143kB 187kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\888537\AppData\Local\Temp\pip-build-b4mwr93n\evernote\setup
.py", line 6
        exec x
             ^
    SyntaxError: Missing parentheses in call to 'exec'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\888537\A
ppData\Local\Temp\pip-build-b4mwr93n\evernote\

How can I fix this installation problem using pypdfocr library?

+4
source share
1 answer

Use Python 2.x instead of 3.x, or find a line with a syntax error and add parentheses.

See in Python 3 exec is a function, but in Python 2 exec is a command.

So, in Python 3, you have to put the arguments in brackets to properly call exec ().

So, you are trying to install a package in Python3 designed for Python 2.

At least there is a script installation.

, , . PyPDFOCR, , tesseract OCRing , , PDFMiner PDF.

PIP, , , , setup.py, python setup.py.

, script Python 2, , Python 2. pip Python.

- Anaconda.

.

+1

All Articles