rows icon indicating copy to clipboard operation
rows copied to clipboard

Dependencies for plugins not clear, updating docs is desirable

Open bernardoccordeiro opened this issue 4 years ago • 4 comments

While using rows for a project, could not use the import_from_pdf function after putting rows as a dependency. The solution, ultimately, was to also include PyMuPDF and cached_property as dependencies for my project, so as to enable the pdf plugin for rows. This information, however, is not clear by looking only at the docs. It would be desirable to list the dependencies for each plugin in the docs in a clearer manner.

bernardoccordeiro avatar Dec 04 '19 22:12 bernardoccordeiro

Running

$ pip install rows[pdf]

also gives me a lot of errors, even after manually installing some MyPDF system packages:

sudo apt install mupdf libmupdf-dev

The error log is so long that I can't see the whole of it in the terminal, even scrolling all the way back. So I'm going to include just the final part of it:

^
    fitz/fitz_wrap.c: In function ‘JM_point_from_py’:
    fitz/fitz_wrap.c:3315:1: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
    fitz/fitz_wrap.c: In function ‘JM_irect_from_py’:
    fitz/fitz_wrap.c:3287:1: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of PyMuPDF
Command "/home/user/project/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-30mdr2l5/pymupdf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-wszvyvx5-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/project/env/include/site/python3.6/pymupdf" failed with error code 1 in /tmp/pip-build-30mdr2l5/pymupdf/

The installation instructions in the documentation don't explain how to install the PDF plugin at all.

augusto-herrmann avatar May 27 '20 21:05 augusto-herrmann

pip install cached_property pymupdf requests requests-cache tqdm

try and tell me if it works

endersonmaia avatar May 27 '20 23:05 endersonmaia

It found out how to make it work.

It turns out that the pymupdf package, which rows depends upon, needs pip to be at least version 19 to install. Ubuntu 18.04 comes with a very old version of pip (version 9), so you'll have to remember to manually upgrade it inside your virtualenv first, before trying to install rows:

$ source env/bin/activate
(env) $ pip install -U pip

IMHO pymupdf should just put a pin in its requirements for the required version of pip. That way it would save people's time having to look it up like I did.

Including a tip in the documentation of rows to remember to upgrade pip before installing also wouldn't hurt.

augusto-herrmann avatar May 28 '20 13:05 augusto-herrmann

IMHO pymupdf should just put a pin in its requirements for the required version of pip. That way it would save people's time having to look it up like I did.

To always try a PIP upgrade is recommended in the documentation! Naming a required PIP version is quite challenging, because both, PIP and the used wheel builder cibuildwheel have a small mean time between versions: PIP alone counts 13 versions in 2021 by end of October! Also, there obviously are different platform tags and manylinux versions (linux Intel and Linux ARM), which have not been supported by PIP at the same point in time. So bottom line is: just try to upgrade pip before installing a package with binaries (IAW: PyMuPDF is by far not alone recommending this).

JorjMcKie avatar Nov 22 '21 09:11 JorjMcKie