I'm trying to read in a pdf and get the text from it. I'm new to using PyMuPDF, but I did follow code I saw online pretty much line for line. However, when I read in the document, I get a fitz.Document object that cannot be opened. Spyder returns the error, "The variable is not picklable." Has anyone ran into this problem, and do you have any ideas how to handle? I tried to switch the PDF just to be sure. I also tried using dill (dill.detect.baditems(doc)) to diagnose, but it just returns the path of my PDF.
import os
import fitz
import pickle
import dill
file_i = r'C:\Users\FilesToRead\EEI (4968).pdf'
doc = fitz.open(filename = file_i, filetype="pdf")
I've omitted the rest of the code. The error starts with the doc variable.