美文网首页
camelot 安装和使用踩坑

camelot 安装和使用踩坑

作者: JeremyL | 来源:发表于2022-12-26 00:27 被阅读0次

    #报错1 AttributeError: module 'camelot' has no attribute 'read_pdf'

    • 卸载camelot,重新安装
    pip uninstall camelot
    pip install "camelot-py[base]"
    

    #报错2 Getting PyPDF2 error while using the camelot library

    pip uninstall PyPDF2
    pip uninstall PyPDF2===1.26.0
    

    # ghostscript安装

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
    brew install ghostscript
    

    # 使用camelot

    import camelot.io as camelot
    import glob
    PDFFile = glob.glob(r'./PDF/*.pdf')
    tables = camelot.read_pdf(PDFFile[1], pages='all')   
    print(tables[0].df) 
    tables[0].to_csv("test.csv ")
    

    # 参考

    Camelot: PDF Table Extraction for Humans
    Install ghostscript on Mac OSX
    AttributeError: module 'camelot' has no attribute 'read_pdf'

    相关文章

      网友评论

          本文标题:camelot 安装和使用踩坑

          本文链接:https://www.haomeiwen.com/subject/vvwwqdtx.html