python - 如何安装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.
解决方案
即使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 。为此,我建议执行以下步骤:
- 从 pypi下载pypdfocr-0.9.1.tar.gz
- 解压 tar.gz 并手动更改
evernote
为evernote3
requirements.txt
- 跑
python setup.py install
这应该evernote3
作为要求下载和安装,然后继续安装PyPDFOCR
.
但是,如果evernote3
API 与 API 不同,evernote
或者其他部分PyPDFOCR
依赖于这种情况,这可能会失败,python2
在这种情况下,您将不得不进行更多的 manula 调整或使用虚拟环境python2
当然,您也可以搜索另一个更新并满足您需求的库。
推荐阅读
- magento2 - 在 Magento 2 中,如何通过管理面板上的自定义模块获取当前产品 ID
- npm - 列出 npm 本地模块会产生丢失的错误
- spring - 如果应用程序中抛出异常,Spring 不会回滚事务
- python - 在请求中提交表单后处理重定向
- spring-boot - Spring Boot 应用程序的 Tomcat 7 部署问题
- javafx - 获取 java.lang.NoSuchMethodException: javafx.application.Platform.startup(java.lang.Runnable)
- javascript - ajax .show() 在注册时不显示隐藏的 div?
- angular - 属性“AppBrowserModule”必须后跟一个“:”Angular 6 Universal
- android - FBSDK Share 在 react-native 应用程序中不起作用。仅在某些安卓设备上
- android - 如何为 armv8 编译本机库?