0

I tried to install PyMuPDF on Python 3.9 when first I installed by pip install PymuPDF and re-checked by pip list like this"

But when I imported PyMuPDF:

 ModuleNotFoundError: No module named 'PyMuPDF'

Next, I tried to install PymuPDF from doc, it said I need install MuPDF first, and install with Wheel, I tried both: pip install C:\Users\Admin\Desktop/PyMuPDF-1.19.6-cp310-cp310-win_amd64.whl and pip install PyMuPDF-1.19.6-cp310-cp310-win_amd64.whl but reviced error:

 yMuPDF-1.19.6-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.

What should i do to install PyMuPDF, thank you all.

D.L
  • 4,339
  • 5
  • 22
  • 45

2 Answers2

0

PyMuPDF is available with a wheel under all Windows versions - you should have no problem at all. But please follow this procedure:

  1. Make sure your pip is the current one. This ensures that any changes in supported platform tags are known to pip.
  2. Then install PyMuPDF.

So overall

py -3.10 -m pip install -U pip
py -3.10 -m pip install -U pymupdf

This should simply work! In your script however you must do import fitz - this is the top-level name of the package.

cigien
  • 57,834
  • 11
  • 73
  • 112
Jorj McKie
  • 2,062
  • 1
  • 13
  • 17
0

I know this is an old question but it looks like you are incorrectly importing the module. The pymupdf module is imported as follows:

import fitz 

Not "import pymupdf" as you did in the code provided. The history behind this is given in the documentation: https://pymupdf.readthedocs.io/en/latest/tutorial.html

Melch
  • 11
  • 4