python - 我在为 python 安装 pdftotext 时遇到困难

标签 python pdftotext poppler

我正在尝试安装 pdftotext,但即使在安装可视化工具后我仍然收到相同的错误。

pip install 都会发生这种情况,我只是想在我的目录中找到它...

终端输出如下:

C:\Users\garec\Downloads>pip3 install pdftotext-2.1.4.tar.gz
Processing c:\users\garec\downloads\pdftotext-2.1.4.tar.gz
Using legacy setup.py install for pdftotext, since package 'wheel' is not installed.
Installing collected packages: pdftotext
    Running setup.py install for pdftotext ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\garec\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\garec\\AppData\\Local\\Temp\\pip-req-build-9ov7_rup\\setup.py'"'"'; __file__='"'"'C:\\Users\\garec\\AppData\\Local\\Temp\\pip-req-build-9ov7_rup\\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\garec\AppData\Local\Temp\pip-record-4zlbnvu1\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\garec\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\pdftotext'
         cwd: C:\Users\garec\AppData\Local\Temp\pip-req-build-9ov7_rup\
    Complete output (7 lines):
    WARNING: pkg-config not found--guessing at poppler version.
             If the build fails, install pkg-config and try again.
    running install
    running build
    running build_ext
    building 'pdftotext' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\garec\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\garec\\AppData\\Local\\Temp\\pip-req-build-9ov7_rup\\setup.py'"'"'; __file__='"'"'C:\\Users\\garec\\AppData\\Local\\Temp\\pip-req-build-9ov7_rup\\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\garec\AppData\Local\Temp\pip-record-4zlbnvu1\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\garec\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\pdftotext' Check the logs for full command output.

最佳答案

在执行 pip install pdftotext 之前尝试 brew install pkg-config poppler (:

关于python - 我在为 python 安装 pdftotext 时遇到困难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62974338/

相关文章:

python - Pandas to_csv : suppress scientific notation in csv file when writing pandas to csv

python - 子进程没有输出任何内容

php - Pdftohtml Poppler 工具不适用于 centOs

java - 是否可以从不允许使用 "Page Extraction"的 PDF 中提取文本?

python - 即使 pdf 文件被裁剪后,整个页面的内容仍然存在

python - PySpark:如何在 worker 上安装 linux 命令行工具?

python - 如何在 google colab 上安装 poppler

python - 如何从 yaml 文件中删除文本 "!!omap"?

python - Scrapy:获取两个标识符之间的文本

python - 如何安装sklearn?