Pymupdf: Question / Comment: Can i install using pip

Created on 25 Aug 2020  路  1Comment  路  Source: pymupdf/PyMuPDF

In the installation i have seen a different way to install a python package

generally we use pip

I have installed using pip install pymupdf and it got installed

>> import fitz
>> print(fitz.__doc__)
PyMuPDF 1.16.3: Python bindings for the MuPDF 1.16.0 library.
Version date: 2019-10-01 09:01:06.
Built for Python 3.7 on linux (64-bit).

But then when i try

>> from fitz.__main__ import main as fitz_command
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-925f641fec03> in <module>
      1 import fitz
----> 2 from fitz.__main__ import main as fitz_command

ModuleNotFoundError: No module named 'fitz.__main__'

The following are the directory contents of fitz

$ cd /lib/python3.7/site-packages/fitz
$ ls   
_fitz.cpython-37m-x86_64-linux-gnu.so  fitz.py  __init__.py  __pycache__  utils.py

I am using archlinux. I want to use the

python -m fitz join -o output.pdf file1.pdf file2.pdf file3.pdf

but it says
/usr/bin/python: No module named fitz.__main__; 'fitz' is a package and cannot be directly executed

question resolved

Most helpful comment

SOLVED IT
I got the package installed using aur (https://aur.archlinux.org/packages/python-pymupdf/)

i removed the pip installation

pip uninstall pymupdf

and then installed it using the https://aur.archlinux.org/packages/python-pymupdf/

yay -S python-pymupdf  #in archlinux only)

Now the command

python -m fitz join -o output.pdf file1.pdf file2.pdf file3.pdf

works

>All comments

SOLVED IT
I got the package installed using aur (https://aur.archlinux.org/packages/python-pymupdf/)

i removed the pip installation

pip uninstall pymupdf

and then installed it using the https://aur.archlinux.org/packages/python-pymupdf/

yay -S python-pymupdf  #in archlinux only)

Now the command

python -m fitz join -o output.pdf file1.pdf file2.pdf file3.pdf

works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tanaskumar picture tanaskumar  路  3Comments

Gabriellavoura picture Gabriellavoura  路  4Comments

hbh112233abc picture hbh112233abc  路  4Comments

cherryjo18 picture cherryjo18  路  3Comments

liamsuma picture liamsuma  路  3Comments