首页 > 解决方案 > 如何安装pypdfocr?

问题描述

尝试在 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.

标签: pythonocr

解决方案


即使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)安装该要求,但您可以使用该版本进行尝试,该版本在 pypi 上python3称为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依赖于这种情况,这可能会失败,python2在这种情况下,您将不得不进行更多的 manula 调整或使用虚拟环境python2

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


推荐阅读