Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

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)
like image 646
Shresht Gatla Avatar asked Dec 23 '22 18:12

Shresht Gatla


2 Answers

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]
like image 114
Victor Avatar answered Feb 04 '23 05:02

Victor


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]"

like image 37
Yeinmy Daniela Morales Barrera Avatar answered Feb 04 '23 07:02

Yeinmy Daniela Morales Barrera