无法安装poppler库

huangapple go评论90阅读模式
英文:

Unable to install poppler library

问题

抱歉,我不能执行代码。但是,看起来您安装了cmake,但在安装python-poppler时仍然遇到了问题。您在执行命令时遇到了类似这样的错误:

CMake Error at .../FindPackageHandleStandardArgs.cmake:230:
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)

这个错误表明找不到PkgConfigPkgConfig是一个帮助管理库编译和链接的工具,某些软件包可能需要它来找到相关的依赖项。

您可能需要安装PkgConfig,具体方法取决于您所用操作系统的包管理器。在大多数 Linux 发行版上,您可以使用以下命令安装:

sudo apt-get install pkg-config   # 对于基于 Debian 的系统
sudo yum install pkgconfig        # 对于基于 Red Hat 的系统

如果您使用的是 macOS,可以使用 Homebrew 安装:

brew install pkg-config

如果您在 Windows 上使用 MSYS2,可以通过其包管理器安装:

pacman -S mingw-w64-x86_64-pkg-config

安装了PkgConfig后,再次尝试安装python-poppler,看能否解决问题。

英文:

I am trying to install poppler. Its a requirement for one of the projects: <https://github.com/idea-fasoc/datasheet-scrubber/tree/master/src/table_extraction>

Every time I try in Anaconda Prompt, I get this error.
The conda command doesn't resolve the environment, hence I tried using pip

I installed cmake. I also installed it via VS installer.<br>
This is the error I am still getting. Any help will be greatly appreciated!

(base) C:\Windows\System32&gt;pip install python-poppler
Collecting python-poppler
Using cached python-poppler-0.3.0.tar.gz (823 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: python-poppler
Building wheel for python-poppler (setup.py) ... error
error: subprocess-exited-with-error
&#215; python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─&gt; [103 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\poppler
copying src\poppler\destination.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\document.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\embeddedfile.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\font.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\image.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\page.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagerenderer.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagetransition.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\rectangle.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\toc.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\utilities.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\_version.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\__init__.py -&gt; build\lib.win-amd64-cpython-39\poppler
creating build\lib.win-amd64-cpython-39\poppler\cpp
copying src\poppler\cpp\__init__.py -&gt; build\lib.win-amd64-cpython-39\poppler\cpp
running egg_info
writing src\python_poppler.egg-info\PKG-INFO
writing dependency_links to src\python_poppler.egg-info\dependency_links.txt
writing top-level names to src\python_poppler.egg-info\top_level.txt
reading manifest file &#39;src\python_poppler.egg-info\SOURCES.txt&#39;
reading manifest template &#39;MANIFEST.in&#39;
adding license file &#39;LICENSE.txt&#39;
writing manifest file &#39;src\python_poppler.egg-info\SOURCES.txt&#39;
running build_ext
C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py:32: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
cmake_version = LooseVersion(
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.34.31942.0
-- The CXX compiler identification is MSVC 19.34.31942.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- pybind11 v2.9.2
-- Found PythonInterp: C:/ProgramData/Anaconda3/python.exe (found version &quot;3.9.13&quot;)
-- Found PythonLibs: C:/ProgramData/Anaconda3/libs/python39.lib
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
CMake Error at C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
CMakeLists.txt:13 (find_package)
-- Configuring incomplete, errors occurred!
See also &quot;C:/Users/halda/AppData/Local/Temp/pip-install-onyki_zr/python-poppler_a0472eeab1dd487f8486d308273da89b/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeOutput.log&quot;.
Traceback (most recent call last):
File &quot;&lt;string&gt;&quot;, line 2, in &lt;module&gt;
File &quot;&lt;pip-setuptools-caller&gt;&quot;, line 34, in &lt;module&gt;
File &quot;C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py&quot;, line 76, in &lt;module&gt;
setup(
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py&quot;, line 87, in setup
return distutils.core.setup(**attrs)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py&quot;, line 185, in setup
return run_commands(dist)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py&quot;, line 201, in run_commands
dist.run_commands()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 973, in run_commands
self.run_command(cmd)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py&quot;, line 1217, in run_command
super().run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 992, in run_command
cmd_obj.run()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\wheel\bdist_wheel.py&quot;, line 299, in run
self.run_command(&#39;build&#39;)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py&quot;, line 319, in run_command
self.distribution.run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py&quot;, line 1217, in run_command
super().run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 992, in run_command
cmd_obj.run()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build.py&quot;, line 24, in run
super().run()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\build.py&quot;, line 132, in run
self.run_command(cmd_name)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py&quot;, line 319, in run_command
self.distribution.run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py&quot;, line 1217, in run_command
super().run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 992, in run_command
cmd_obj.run()
File &quot;C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py&quot;, line 39, in run
self.build_extension(ext)
File &quot;C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py&quot;, line 68, in build_extension
subprocess.check_call(
File &quot;C:\ProgramData\Anaconda3\lib\subprocess.py&quot;, line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command &#39;[&#39;cmake&#39;, &#39;C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b&#39;, &#39;-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp&#39;, &#39;-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe&#39;, &#39;-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp&#39;, &#39;-A&#39;, &#39;x64&#39;]&#39; returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-poppler
Running setup.py clean for python-poppler
Failed to build python-poppler
Installing collected packages: python-poppler
Running setup.py install for python-poppler ... error
error: subprocess-exited-with-error
&#215; Running setup.py install for python-poppler did not run successfully.
│ exit code: 1
╰─&gt; [107 lines of output]
running install
C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\poppler
copying src\poppler\destination.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\document.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\embeddedfile.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\font.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\image.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\page.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagerenderer.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagetransition.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\rectangle.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\toc.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\utilities.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\_version.py -&gt; build\lib.win-amd64-cpython-39\poppler
copying src\poppler\__init__.py -&gt; build\lib.win-amd64-cpython-39\poppler
creating build\lib.win-amd64-cpython-39\poppler\cpp
copying src\poppler\cpp\__init__.py -&gt; build\lib.win-amd64-cpython-39\poppler\cpp
running egg_info
writing src\python_poppler.egg-info\PKG-INFO
writing dependency_links to src\python_poppler.egg-info\dependency_links.txt
writing top-level names to src\python_poppler.egg-info\top_level.txt
reading manifest file &#39;src\python_poppler.egg-info\SOURCES.txt&#39;
reading manifest template &#39;MANIFEST.in&#39;
adding license file &#39;LICENSE.txt&#39;
writing manifest file &#39;src\python_poppler.egg-info\SOURCES.txt&#39;
running build_ext
C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py:32: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
cmake_version = LooseVersion(
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.34.31942.0
-- The CXX compiler identification is MSVC 19.34.31942.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- pybind11 v2.9.2
-- Found PythonInterp: C:/ProgramData/Anaconda3/python.exe (found version &quot;3.9.13&quot;)
-- Found PythonLibs: C:/ProgramData/Anaconda3/libs/python39.lib
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
CMake Error at C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
CMakeLists.txt:13 (find_package)
-- Configuring incomplete, errors occurred!
See also &quot;C:/Users/halda/AppData/Local/Temp/pip-install-onyki_zr/python-poppler_a0472eeab1dd487f8486d308273da89b/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeOutput.log&quot;.
Traceback (most recent call last):
File &quot;&lt;string&gt;&quot;, line 2, in &lt;module&gt;
File &quot;&lt;pip-setuptools-caller&gt;&quot;, line 34, in &lt;module&gt;
File &quot;C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py&quot;, line 76, in &lt;module&gt;
setup(
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py&quot;, line 87, in setup
return distutils.core.setup(**attrs)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py&quot;, line 185, in setup
return run_commands(dist)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py&quot;, line 201, in run_commands
dist.run_commands()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 973, in run_commands
self.run_command(cmd)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py&quot;, line 1217, in run_command
super().run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 992, in run_command
cmd_obj.run()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py&quot;, line 68, in run
return orig.install.run(self)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\install.py&quot;, line 692, in run
self.run_command(&#39;build&#39;)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py&quot;, line 319, in run_command
self.distribution.run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py&quot;, line 1217, in run_command
super().run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 992, in run_command
cmd_obj.run()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build.py&quot;, line 24, in run
super().run()
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\build.py&quot;, line 132, in run
self.run_command(cmd_name)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py&quot;, line 319, in run_command
self.distribution.run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py&quot;, line 1217, in run_command
super().run_command(command)
File &quot;C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py&quot;, line 992, in run_command
cmd_obj.run()
File &quot;C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py&quot;, line 39, in run
self.build_extension(ext)
File &quot;C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py&quot;, line 68, in build_extension
subprocess.check_call(
File &quot;C:\ProgramData\Anaconda3\lib\subprocess.py&quot;, line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command &#39;[&#39;cmake&#39;, &#39;C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b&#39;, &#39;-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp&#39;, &#39;-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe&#39;, &#39;-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp&#39;, &#39;-A&#39;, &#39;x64&#39;]&#39; returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
&#215; Encountered error while trying to install package.
╰─&gt; python-poppler
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Edit: Updating the error I get even after installing the cmake

答案1

得分: 1

就像这一行一样

RuntimeError: 必须安装 CMake 才能构建以下扩展: poppler.cpp.modules

表示我会尝试安装 cmake 然后再次运行它

你可以通过

pip install cmake

进行安装

英文:

like the line

RuntimeError: CMake must be installed to build the following extensions: poppler.cpp.modules

says I would try to install cmake and then run it again

you can install it via

pip install cmake

huangapple
  • 本文由 发表于 2023年2月19日 01:07:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75494962.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定