python3でpytesseractを使うと以下のようなエラーが出てしまいます
対処法を教えてくださるとありがたいです、、
python3
1from nltk.stem import WordNetLemmatizer 2lemmatizer=WordNetLemmatizer() 3qlist=["単語2047個"] 4ty=input("which type?") 5import os,pytesseract,nltk 6nltk.download('all') 7from PIL import Image 8counter1=0 9counter2=0 10os.chdir(f"./{ty}") 11for im in os.listdir(".")[1:]: 12 img=Image.open(im) 13 text=pytesseract.image_to_string(img,lang="eng") 14 text=text.replace("\n","") 15 text=nltk.word_tokenize(text) 16 text=nltk.pos_tag(text) 17 for word,type in list(set(text)): 18 if type in ["JJ","JJR","JJS"]: 19 counter1+=1 20 if lemmatizer.lemmatize(word,pos="a") in qlist: 21 counter2+=1 22 else: 23 print(word+" leaked") 24 elif type in ["NN","NNS","NNP","NNPS"]: 25 counter1+=1 26 if lemmatizer.lemmatize(word,pos="n"): 27 counter2+=1 28 else: 29 print(word+" leaked") 30 elif type in ["RB","RBS","RBR"]: 31 counter1+=1 32 if lemmatizer.lemmatize(word,pos="r") in qlist: 33 counter2+=1 34 else: 35 print(word+" leaked") 36 elif type in ["VB","VBD","VBG","VBN","VBP","VBZ"]: 37 counter1+=1 38 if lemmatizer.lemmatize(word,pos="v") in qlist: 39 counter2+=1 40 else: 41 print(word+" leaked") 42print("system covers"+str(100*counter2/counter1)+"%")
ターミナルでtesseractを使ってOCRができる環境になってますか?