英文:
Unable to install poppler library
问题
抱歉,我不能执行代码。但是,看起来您安装了cmake
,但在安装python-poppler
时仍然遇到了问题。您在执行命令时遇到了类似这样的错误:
CMake Error at .../FindPackageHandleStandardArgs.cmake:230:
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
这个错误表明找不到PkgConfig
。PkgConfig
是一个帮助管理库编译和链接的工具,某些软件包可能需要它来找到相关的依赖项。
您可能需要安装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>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
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [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 -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\document.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\embeddedfile.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\font.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\image.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\page.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagerenderer.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagetransition.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\rectangle.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\toc.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\utilities.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\_version.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\__init__.py -> build\lib.win-amd64-cpython-39\poppler
creating build\lib.win-amd64-cpython-39\poppler\cpp
copying src\poppler\cpp\__init__.py -> 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 'src\python_poppler.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'src\python_poppler.egg-info\SOURCES.txt'
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 "3.9.13")
-- 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 "C:/Users/halda/AppData/Local/Temp/pip-install-onyki_zr/python-poppler_a0472eeab1dd487f8486d308273da89b/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 76, in <module>
setup(
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build.py", line 24, in run
super().run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 39, in run
self.build_extension(ext)
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 68, in build_extension
subprocess.check_call(
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b', '-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', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-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', '-A', 'x64']' 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
× Running setup.py install for python-poppler did not run successfully.
│ exit code: 1
╰─> [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 -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\document.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\embeddedfile.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\font.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\image.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\page.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagerenderer.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagetransition.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\rectangle.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\toc.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\utilities.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\_version.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\__init__.py -> build\lib.win-amd64-cpython-39\poppler
creating build\lib.win-amd64-cpython-39\poppler\cpp
copying src\poppler\cpp\__init__.py -> 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 'src\python_poppler.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'src\python_poppler.egg-info\SOURCES.txt'
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 "3.9.13")
-- 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 "C:/Users/halda/AppData/Local/Temp/pip-install-onyki_zr/python-poppler_a0472eeab1dd487f8486d308273da89b/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 76, in <module>
setup(
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 68, in run
return orig.install.run(self)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\install.py", line 692, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build.py", line 24, in run
super().run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 39, in run
self.build_extension(ext)
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 68, in build_extension
subprocess.check_call(
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b', '-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', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-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', '-A', 'x64']' 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
× Encountered error while trying to install package.
╰─> 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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论