简体   繁体   English

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

[英]No module named poppler with python-poppler installed

please, don't mark it as duplicate, because solutions to similar questions don't work for me 请不要将其标记为重复,因为类似问题的解决方案对我不起作用

My system is ubuntu 16.04, I'm using python 2.7.12 我的系统是ubuntu 16.04,我使用的是python 2.7.12

What I am trying to do, is to use pdftohtml to convert pdf files to html. 我想要做的是使用pdftohtml将pdf文件转换为html。 It seems that I could do it with poppler. 似乎我可以用poppler做到这一点。

I've installed python-poppler with sudo apt-get install and it seems installed: 我已经安装了带有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

however, on import poppler it throws an import error. 但是,在导入poppler时会抛出导入错误。 What am I missing here? 我在这里错过了什么?

Ok, the problem was my virtual env wasn't created with any parameters - so --no-site-packages was used as a default value. 好吧,问题是我的虚拟环境不是用任何参数创建的 - 所以--no-site-packages被用作默认值。 when I recreated it using mkvirtualenv --system-site-packages, everything is ok. 当我使用mkvirtualenv --system-site-packages重新创建它时,一切都很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM