我正在尝试使用pdf和python进行文本提取。由于我已经扫描了pdf,因此我尝试使用Poppler和pyqt5。不幸的是,我无法在我的机器上正确安装python-poppler-qt5。我用下面的命令来安装pyqt5和
pip安装PyQt5 (这对我有用)
pip install python-poppler-qt5 (这在安装时出现以下异常)
(base) C:\Users\Manchat>pip install python-poppler-qt5
Collecting python-poppler-qt5
Using cached https://files.pythonhosted.org/packages/af/e7/aa451d4ca0910472c4442d8aa6ef44300852926d85ad033b029a22157027/python-poppler-qt5-0.24.2.tar.gz
Building wheels for collected packages: python-poppler-qt5
Building wheel for python-poppler-qt5 (setup.py) ... error
ERROR: Complete output from command 'c:\users\manchat\appdata\local\continuum\anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Manchat\\AppData\\Local\\Temp\\pip-install-ygve0spw\\python-poppler-qt5\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Manchat\AppData\Local\Temp\pip-wheel-g0bkt68v' --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_ext
building 'popplerqt5' extension
Can't determine version of poppler-qt5
C:/Users/Manchat/AppData/Local/Continuum/anaconda3\Library\bin\sip.exe -I C:/Users/Manchat/AppData/Local/Continuum/anaconda3\sip -t POPPLER_V0_20_0 -c build\temp.win-amd64-3.7\Release -b build\temp.win-amd64-3.7\Release\poppler-qt5.sbf -I C:/Users/Manchat/AppData/Local/Continuum/anaconda3\sip\PyQt5 -t WS_WIN -t Qt_5_9_3 poppler-qt5.sip
sip: Deprecation warning: poppler-qt5.sip:1: %Module version numbers are deprecated and ignored
sip: QDomElement is undefined
error: command 'C:/Users/Manchat/AppData/Local/Continuum/anaconda3\\Library\\bin\\sip.exe' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for python-poppler-qt5
Running setup.py clean for python-poppler-qt5
Failed to build python-poppler-qt5
Installing collected packages: python-poppler-qt5
Running setup.py install for python-poppler-qt5 ... error
ERROR: Complete output from command 'c:\users\manchat\appdata\local\continuum\anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Manchat\\AppData\\Local\\Temp\\pip-install-ygve0spw\\python-poppler-qt5\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Manchat\AppData\Local\Temp\pip-record-bqt5f0xx\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
building 'popplerqt5' extension
Can't determine version of poppler-qt5
C:/Users/Manchat/AppData/Local/Continuum/anaconda3\Library\bin\sip.exe -I C:/Users/Manchat/AppData/Local/Continuum/anaconda3\sip -t POPPLER_V0_20_0 -c build\temp.win-amd64-3.7\Release -b build\temp.win-amd64-3.7\Release\poppler-qt5.sbf -I C:/Users/Manchat/AppData/Local/Continuum/anaconda3\sip\PyQt5 -t WS_WIN -t Qt_5_9_3 poppler-qt5.sip
sip: Deprecation warning: poppler-qt5.sip:1: %Module version numbers are deprecated and ignored
sip: QDomElement is undefined
error: command 'C:/Users/Manchat/AppData/Local/Continuum/anaconda3\\Library\\bin\\sip.exe' failed with exit status 1
----------------------------------------
ERROR: Command "'c:\users\manchat\appdata\local\continuum\anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Manchat\\AppData\\Local\\Temp\\pip-install-ygve0spw\\python-poppler-qt5\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Manchat\AppData\Local\Temp\pip-record-bqt5f0xx\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Manchat\AppData\Local\Temp\pip-install-ygve0spw\python-poppler-qt5\
我尝试做很多不同的事情,但无法成功完成此安装。如果有人可以帮我解决这个问题,那将是很大的帮助。