Open bernardoccordeiro opened 4 years ago
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.
pip install cached_property pymupdf requests requests-cache tqdm
try and tell me if it works
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.
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).
While using
rows
for a project, could not use theimport_from_pdf
function after puttingrows
as a dependency. The solution, ultimately, was to also includePyMuPDF
andcached_property
as dependencies for my project, so as to enable the pdf plugin forrows.
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.