Shresht Gatla
Shresht Gatla

Reputation: 171

ImportError: cannot import name 'TableList' from 'camelot.core'

i tried to extract the tables from a pdf using camelot but it is showing this error message!

import camelot
    tables = camelot.read_pdf("C:/Users/shres/Desktop/PY/Arun District Council_ASR-2019.pdf", pages='all')
    tables
    tables.export("test.csv", f='csv')
    tables[0]
    tables[0].parsing_report
    {
        'accuracy' : 99.02,
        'whitespace':12.24,
        'order': 1,
        'page' : 1
    }
    tables[0].to_csv('test.csv')
    tables[0].df
******error: the code shows this error******
ImportError: cannot import name 'TableList' from 'camelot.core' (C:\Users\shres\AppData\Local\Programs\Python\Python38\lib\site-packages\camelot\core\__init__.py)

Upvotes: 15

Views: 27240

Answers (3)

Manjula Devi
Manjula Devi

Reputation: 149

While using Google Colab, Try installing below:

pip uninstall camelot
pip uninstall camelot-py
pip install camelot-py[cv]

# install ghostscript
! apt install ghostscript python3-tk
! pip install ghostscript

Even after installation if it throws same error, try "Restart Runtime" in Colab and that should fix the issue! Worked for me :)

Upvotes: 1

Victor
Victor

Reputation: 314

you might want to reinstall it. Camelot and camelot-py are two different packages but they have the same import name.

pip uninstall camelot
pip uninstall camelot-py
pip install camelot-py[cv]

Upvotes: 29

It will also generate the same problem for me and I know that it is too late but maybe the same thing will happen to other people and as I managed to solve it, it was git cloning the repo and then inside the camelot street I installed the cv with pip install like this:

  1. pip install "camelot-py [cv]"

  2. git clone https://www.github.com/camelot-dev/camelot

  3. cd camelot

  4. pip install ".[cv]"

Upvotes: 2

Related Questions