从几周以来,我一直在尝试安装
pdftotext
python
,但由于之前的poppler问题而面临挑战并失败。
最近我有:
Windows 10
至Windows 11
以启用Sudo
并使用apt
命令sudo apt-get update
sudo apt install python3-pip
sudo apt-get install python-poppler
sudo apt install build-essential libpoppler-cpp-dev pkg-config python3-dev
问题: 现在,当我转到
cmd
并运行
pip install pdftotext
错误:
Collecting pdftotext
Using cached pdftotext-2.2.2.tar.gz (113 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pdftotext
Building wheel for pdftotext (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
running bdist_wheel
running build
running build_ext
building 'pdftotext' extension
creating build
creating build\temp.win-amd64-cpython-39
creating build\temp.win-amd64-cpython-39\Release
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPOPPLER_CPP_AT_LEAST_0_30_0=0 -DPOPPLER_CPP_AT_LEAST_0_58_0=0 -DPOPPLER_CPP_AT_LEAST_0_88_0=0 -IC:\Users\vinee\anaconda3\include -IC:\Users\vinee\anaconda3\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" /EHsc /Tppdftotext.cpp /Fobuild\temp.win-amd64-cpython-39\Release\pdftotext.obj -Wall
pdftotext.cpp
C:\Users\vinee\anaconda3\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pdftotext
Running setup.py clean for pdftotext
Failed to build pdftotext
ERROR: Could not build wheels for pdftotext, which is required to install pyproject.toml-based projects
对于问题,我提到了这篇SO Post,它提到了关于安装
CMAKE
,我已经拥有并再次运行了
C:\Windows\System32>pip install Cmake
WARNING: Ignoring invalid distribution -cipy (c:\users\vinee\anaconda3\lib\site-packages)
Requirement already satisfied: Cmake in c:\users\vinee\anaconda3\lib\site-packages (3.30.4)
WARNING: Ignoring invalid distribution -cipy (c:\users\vinee\anaconda3\lib\site-packages)
但我仍然陷入构建轮错误。接下来我该怎么办。在这方面确实需要帮助。