Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies for plugins not clear, updating docs is desirable #341

Open
bernardoccordeiro opened this issue Dec 4, 2019 · 4 comments
Open

Comments

@bernardoccordeiro
Copy link

bernardoccordeiro commented Dec 4, 2019

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.

@augusto-herrmann
Copy link
Contributor

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.

@endersonmaia
Copy link

pip install cached_property pymupdf requests requests-cache tqdm

try and tell me if it works

@augusto-herrmann
Copy link
Contributor

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.

@JorjMcKie
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants