如何安装pypdfocr?

m.g*_*bin 1 python ocr

在尝试在 python 中安装 pypdfocr 包时出现以下错误。

ERROR: Command errored out with exit status 1:
     command: 'c:\users\User\appdata\local\programs\python\python37-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\GIBIN_~1\\AppData\\Local\\Temp\\pip-install-uansf_7f\\evernote\\setup.py'"'"'; __file__='"'"'C:\\U
sers\\GIBIN_~1\\AppData\\Local\\Temp\\pip-install-uansf_7f\\evernote\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base
 pip-egg-info
         cwd: C:\Users\GIBIN_~1\AppData\Local\Temp\pip-install-uansf_7f\evernote\
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\GIBIN_~1\AppData\Local\Temp\pip-install-uansf_7f\evernote\setup.py", line 6
        exec x
             ^
    SyntaxError: Missing parentheses in call to 'exec'

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Run Code Online (Sandbox Code Playgroud)

Fly*_*ler 5

尽管pypiPyPDFOCR上的项目没有设置任何版本限制,但它列为要求。如果您查看错误消息,您会发现实际上是此安装导致了问题。这并不奇怪,查看Evernote 的 github 页面就会发现:evernote

印象笔记 API 版本 1.28

该 SDK 适用于 Python 2.X

对于 Evernote 的 beta Python 3 SDK,请参阅https://github.com/evernote/evernote-sdk-python3

evernote因此,无法为您的Python版本(3.7)安装该要求,但您可以使用该python3版本进行尝试,该版本在pypi上称为evernote3。为此,我建议执行以下步骤:

  1. 从 pypi下载pypdfocr-0.9.1.tar.gz
  2. 解压 tar.gz 并手动更改evernoteevernote3requirements.txt
  3. 跑步python setup.py install

这应该evernote3根据要求下载并安装,然后继续安装PyPDFOCR

但是,如果evernote3API 与 API 不同evernote,或者如果其他部分PyPDFOCR依赖于 API,则这可能会失败python2,在这种情况下,您将必须进行更多的手动调整或使用虚拟环境python2

当然,您也可以搜索另一个更新并满足您需求的库。