Skip to content

"module 'fitz' has no attribute 'open'" #1155

Description

@RandomAnass

What happened to me is like what happened here and here. But I couldn't solve the bug even by following the same instructions.

Describe the bug (mandatory)

In my virtual environment I have this error :
Error while analysing name.pdf : module 'fitz' has no attribute 'open' .
But I dont get this probelem outside the virtual environment.

To Reproduce (mandatory)

Outside the virtual environment I tried :
import fitz fitz.open()
And I got :
Out[2]: Document(<new PDF, doc# 1>)

To install the modules in my virtual environment I used :
pip3 install -r requirements.txt
And in requirements.txt :

fitz==0.0.1.dev2
PyMuPDF==1.18.15
PyPDF2==1.26.0

Then After the error I tried:
py -3 manage.py shell
>>>import fitz
>>>fitz.open()
And I got:
Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: module 'fitz' has no attribute 'open'

My configuration (mandatory)

  • windows 10, 64 bits
  • Python 3.9.2
  • PyMuPDF version is 1.18.15

The output of print(sys.version, "\n", sys.platform, "\n", fitz.__doc__) is : 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)]
win32
None

for fitz I got:
fitz.__version__

Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'fitz' has no attribute 'version'

Metadata

Metadata

Assignees

Labels

not a bugnot a bug / user error / unable to reproduce

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions