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

Module fiz #17

Open
wookayin opened this issue Oct 11, 2021 · 4 comments
Open

Module fiz #17

wookayin opened this issue Oct 11, 2021 · 4 comments

Comments

@wookayin
Copy link

  File "/usr/local/bin/termpdf.py", line 56, in <module>
    import fitz
ModuleNotFoundError: No module named 'fitz'

This is not listed in setup.py.

@dsanson
Copy link
Owner

dsanson commented Dec 29, 2021

For reasons I do not understand, the module provided by PyMuPDF is called 'fitz'. So this error suggests you don't have PyMuPDF installed.

@typkrft
Copy link

typkrft commented Jan 3, 2022

The same thing happens to me. If I go into a python console it says it fails to import front end. Installing frontend results in this error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/fitz/__init__.py", line 1, in <module>
    from frontend import *
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/frontend/__init__.py", line 1, in <module>
    from .events import *
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/frontend/events/__init__.py", line 1, in <module>
    from .clipboard import *
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/frontend/events/clipboard.py", line 2, in <module>
    from ..dom import Event
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/frontend/dom.py", line 439, in <module>
    from . import dispatcher
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/frontend/dispatcher.py", line 15, in <module>
    from . import config, server
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/frontend/server.py", line 24, in <module>
    app.mount(config.STATIC_ROUTE, StaticFiles(directory=config.STATIC_DIRECTORY), name=config.STATIC_NAME)
  File "/Users/brandon/.asdf/installs/python/3.10.0/lib/python3.10/site-packages/starlette/staticfiles.py", line 53, in __init__
    raise RuntimeError(f"Directory '{directory}' does not exist")
RuntimeError: Directory 'static/' does not exist

Possibly related to this, though I'm not sure how to resolve it. Python Wheel Discussion

@gautampk
Copy link
Contributor

gautampk commented Jan 16, 2022

If you're on M1 macOS you need to do brew install mupdf swig freetype (to get the source dependencies) before running pip3 install pymupdf because for some reason there is no pre-compiled Universal wheel provided (see here, though the discussion is somewhat beyond me).

@typkrft
Copy link

typkrft commented Jan 17, 2022

If you're on M1 macOS you need to do brew install mupdf swig freetype (to get the source dependencies) before running pip3 install pymupdf because for some reason there is no pre-compiled Universal wheel provided (see here, though the discussion is somewhat beyond me).

This unfortunately didn't work for me. I was able in the past to use Rosetta a while back, but keeping up with two brew installations or using non native seemed like a band-aid. It brings me back to the ModuleNotFoundError: No module named 'fitz' error.

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