python - 没有安装 python-poppler 的名为 poppler 的模块

标签 python importerror poppler

请不要将其标记为重复,因为类似问题的解决方案对我不起作用

我的系统是ubuntu 16.04,我用的是python 2.7.12

我想做的是使用 pdftohtml 将 pdf 文件转换为 html。看来我可以用 poppler 来做。

我已经使用 sudo apt-get install 安装了 python-poppler,它似乎已安装:

dpkg -s python-poppler
Package: python-poppler
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 144
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 0.12.1-8.1
Provides: python2.7-poppler
Depends: libc6 (>= 2.4), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.8.0), libpoppler-glib8 (>= 0.18.0), python (>= 2.7), python (<< 2.8), python-gtk2 (>= 2.10.0), python-gobject (>= 2.10.1), python-cairo (>= 1.8.4)
Description: Poppler Python bindings
 This package includes Python bindings for LibPoppler.
 It is needed to run programs written in Python and using Poppler set.
 LibPoppler is a PDF rendering library based on xpdf PDF viewer, and used by
 kpdf and evince PDF viewers.
Original-Maintainer: Andrea Gasparini <gaspa@yattaweb.it>
Homepage: http://launchpad.net/poppler-python

但是,在导入 poppler 时会抛出导入错误。 我在这里缺少什么?

最佳答案

好的,问题是我的虚拟环境没有使用任何参数创建 - 所以 --no-site-packages 被用作默认值。 当我使用 mkvirtualenv --system-site-packages 重新创建它时,一切正常。

关于python - 没有安装 python-poppler 的名为 poppler 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41959478/

相关文章:

python - 批量保存数据到图像: need speedup

python - 使用 Pandas 按特定列分组时找出空值的百分比

python,在中位数附近找到置信区间

python - 突然导入错误: cannot import name "QtCore" from "PyQt5"

python - 在 Mac 上安装适用于 Python 的 Poppler

python - 如何在 python 中使用 pdf2image 将 pdf 从 url 转换为图像?

python - 当应用程序在gtk.main()中运行时,如何监听套接字?

python - 导入错误:无法导入名称 open_workbook

dart - 导入 'package:using_tabs/tabs/first.dart' ; >> URI 的目标不存在

linux - 如何从 Linux 命令行中提取 "read-protected"PDF 中的所有图像?