我已经使用pip install安装了textract,并在jupyter笔记本中运行了import命令,这会引发以下错误。
我在Windows机器上,并使用conda安装了两个版本的python(2.7和3.6)。我还按照其他帖子中的建议添加了环境变量的路径,但仍然出现错误。
import textract
ImportErrorTraceback (most recent call last)
<ipython-input-2-99b3b0e1733d> in <module>()
1 #Code to extract pdf files
----> 2 import textract
3 text = textract.process("C:/Users/username/Documents/Projects/Attachments/PDF/fileA.pdf")
ImportError: No module named textract
编辑:
我仅在python 2.7上成功安装了textract。我已将以下路径添加到环境变量C:\ Users \ Username \ AppData \ Local \ Continuum \ anaconda3 \ envs \ mypy27 \ C:\ Users \ Username \ AppData \ Local \ Continuum \ anaconda3 \ envs \ mypy27 \ Scripts- ->这是textract文件所在的位置C:\ Users \ Username \ AppData \ Local \ Continuum \ anaconda3 \ envs \ mypy27 \ Lib \ lib-tk C:\ Users \ Username \ AppData \ Local \ Continuum \ anaconda3 \ envs \ mypy27 \ Lib C:\ Users \ Username \ AppData \ Local \ Continuum \ anaconda3 \ envs \ mypy27 \ DLLs
更新:我使用pip install安装了pypdf2,并尝试将其导入到虚拟笔记本电脑中。它返回了相同的错误。我想知道我是否安装不正确。
猛跑小猪
相关分类