saulpw / visidata

A terminal spreadsheet multitool for discovering and arranging data
http://visidata.org
GNU General Public License v3.0
7.79k stars 276 forks source link

Viewing PDFs: External package "pdfminer.high_level" not installed; run: pip install pdfminer.six #2510

Open CharlesARoy opened 2 weeks ago

CharlesARoy commented 2 weeks ago

Hello,

I'm trying to view PDFs with Visidata but I keep getting the following error when I try to open files:

External package "pdfminer.high_level" not installed; run: pip install pdfminer.six

I have Visidata installed with brew so I ran the following command to install pdfminer.six in the visidata environment as @anjakefala explained in #2508.

pip3 install --target /opt/homebrew/Cellar/visidata/3.0.2_1/libexec/bin/ pdfminer.six

When that didn't work, I ran the following commands for good measure, none of which have helped:

pip3 install --target /opt/homebrew/Cellar/visidata/3.0.2_1/libexec/bin/ pdfminer
pip install --target /opt/homebrew/Cellar/visidata/3.0.2_1/libexec/bin/ pdfminer.six
pip install pdfminer.six
pip install pdfminer

According to this page, to fix the pdfminer.high_level issue, you need to install pdfminer.six and import pdfminer.high_level after you import pdfminer. Not sure if that applies here.

Any input is appreciated!

saulpw commented 2 weeks ago

@CharlesARoy Based on what you said from that page, try adding this to your visidatarc:

import pdfminer
import pdfminer.high_level
CharlesARoy commented 2 weeks ago

Wow, thanks for the quick response!

Ok, adding that to my .visidatarc file resulted in the following error: ModuleNotFoundError: No module named 'pdfminer.high_level'

CharlesARoy commented 2 weeks ago

These are the files listed in /opt/homebrew/Cellar/visidata/3.0.2_1/libexec/bin/pdfminer. Does that error mean that a file named high_level.py is missing?

image

saulpw commented 2 weeks ago

It seems like this may be the wrong version of pdfminer then. You may have to do some Python spelunking on this one.