Python Forum

Full Version: using fitz to manipulate pdf
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I used pip3 to install fitz No errors

When I try to import fitz I get:

Quote:>>> import fitz
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import fitz
File "/home/pedro/.local/lib/python3.6/site-packages/fitz/__init__.py", line 1, in <module>
from frontend import *
ModuleNotFoundError: No module named 'frontend'

In

Quote:/home/pedro/.local/lib/python3.6/site-packages/fitz

there are 3 files

frontend.py _init_.py and .DS_Store

and 2 directories

__pycache__ and tools

_init_.py looks like this:

Quote:from frontend import *
import tools
import os.path as op

__version__ = '0.0.1dev2'
__license__ = 'BSD-3'
__author__ = 'Erik Kastman'
__author_email__ = '[email protected]'
__maintainer_email__ = '[email protected]'
__url__ = 'https://github.com/kastman/fitz'
__downloadUrl__ = 'https://github.com/kastman/fitz/releases'

but it obviously does not find frontend.py, so fitz will not import.

Can you please tell me where should I put frontend?? Or where will Python look for frontend.py??
In the current online version (0.0.2), it is from . import *. This could solve the problem. Try to download the latest version of the library.