turicas / rows

A common, beautiful interface to tabular data, no matter the format
GNU Lesser General Public License v3.0
865 stars 136 forks source link

Error converting PDF #301

Closed belisards closed 5 years ago

belisards commented 5 years ago

When I try to convert a PDF to a CSV using rows, I'm receiving this message below. Any clue about what's happening? I tried to convert locally but the error is the same

~$ rows convert http://www.tre-rj.jus.br/site/eleicoes/2018/arquivos/locais.pdf locais.csv Traceback (most recent call last): File "/home/casa/.local/lib/python3.6/site-packages/rows/utils.py", line 266, in import_from_source import_function = getattr(rows, 'importfrom{}'.format(plugin_name)) AttributeError: module 'rows' has no attribute 'import_from_None'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/casa/.local/bin/rows", line 10, in sys.exit(cli()) File "/home/casa/.local/lib/python3.6/site-packages/click/core.py", line 764, in call return self.main(args, kwargs) File "/home/casa/.local/lib/python3.6/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/casa/.local/lib/python3.6/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/casa/.local/lib/python3.6/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/casa/.local/lib/python3.6/site-packages/click/core.py", line 555, in invoke return callback(args, kwargs) File "/home/casa/.local/lib/python3.6/site-packages/rows/cli.py", line 104, in convert verify_ssl=verify_ssl) File "/home/casa/.local/lib/python3.6/site-packages/rows/cli.py", line 52, in _import_table encoding=encoding, *args, *kwargs) File "/home/casa/.local/lib/python3.6/site-packages/rows/utils.py", line 285, in import_from_uri return import_from_source(source, default_encoding, args, kwargs) File "/home/casa/.local/lib/python3.6/site-packages/rows/utils.py", line 268, in import_from_source raise ValueError('Plugin (import) "{}" not found'.format(plugin_name)) ValueError: Plugin (import) "None" not found

turicas commented 5 years ago

You forgot to install PDF dependencies and probably you didn't install the current rows version (which has the PDF plugin code). Try these:

pip install -U cached-property click pymupdf requests requests-cache tqdm https://github.com/turicas/rows/archive/develop.zip#egg=rows

Note: this will change soon (will be easier to install and docs updated).