You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Github cv-parser项目中pdfminer导入PDFParser报错求助

Fix: ImportError: cannot import name PDFParser

I've run into this exact issue before when working with older resume parser projects. Let's break down the two main problems causing this error and fix them step by step:

1. You're using an obsolete/unmaintained pdfminer package

The original pdfminer package is no longer updated, and modern Python projects rely on pdfminer.six—a Python 3-compatible fork that's actively maintained. Let's clean up and install the correct package:

  • Uninstall the old pdfminer (if it's already installed):
    pip uninstall pdfminer -y
    
  • Install the supported, compatible version:
    pip install pdfminer.six
    

2. The import path in your code is incorrect

Looking at your error trace, you're trying to import PDFParser from pdfminer.pdfdocument—but PDFParser actually belongs to the pdfminer.pdfparser module! Open parsecv.py and fix line 14 to:

from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument

(You can combine these into a single line if you prefer, but splitting them makes it clearer which class comes from which module.)

After making these two changes, run your script again—the import error should be resolved.

内容的提问来源于stack exchange,提问作者HADDAD Ahmed

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:13:24