Python 错误:ModuleNotFoundError:没有名为“Image”的模块

Python 错误:ModuleNotFoundError:没有名为“Image”的模块,python,image,image-processing,ocr,Python,Image,Image Processing,Ocr,我得到以下错误: ModuleNotFoundError:没有名为“Image”的模块 运行以下OCR脚本时: import Image from tesseract import image_to_string print(image_to_string(Image.open('marlboro.png'), lang='eng')) 我正在使用Spider through Anaconda并安装了枕头。看看,在那里你可以看到一些基本示例。简而言之:您需要指定从PIL导入图像: 请看一下

我得到以下错误:

ModuleNotFoundError:没有名为“Image”的模块

运行以下OCR脚本时:

import Image
from tesseract import image_to_string


print(image_to_string(Image.open('marlboro.png'), lang='eng'))
我正在使用Spider through Anaconda并安装了枕头。

看看,在那里你可以看到一些基本示例。简而言之:您需要指定从PIL导入图像:

请看一下,在这里您可以看到一些基本示例。简而言之:您需要指定从PIL导入图像:

应使用pip安装PyteSeract。另请参见:

然后:

from PIL import Image
from pytesseract import image_to_string

print(image_to_string(Image.open('marlboro.png'), lang='eng'))
或者使用python跨平台模块tesseract:

并像在问题中一样使用它:

from PIL import Image
from tesseract import image_to_string

print(image_to_string(Image.open('marlboro.png'), lang='eng'))
应使用pip安装PyteSeract。另请参见:

然后:

from PIL import Image
from pytesseract import image_to_string

print(image_to_string(Image.open('marlboro.png'), lang='eng'))
或者使用python跨平台模块tesseract:

并像在问题中一样使用它:

from PIL import Image
from tesseract import image_to_string

print(image_to_string(Image.open('marlboro.png'), lang='eng'))

感谢我将此更改为,它删除了以前的错误,但弹出了一个新错误-从PIL导入图像从PyteSeract导入图像到字符串打印图像到字符串图像。打开“marlboro.png”,但我现在收到一个新错误-感谢我更改了此错误,它删除了以前的错误,但弹出了一个新错误-从PIL导入图像从PyteSeract导入图像\u到字符串打印图像\u到字符串图像。打开'marlboro.png'但我现在收到一个新错误-我现在收到以下错误-文件C:\ProgramData\Anaconda3\lib\subprocess.py,第997行,在_execute_子startupinfo PermissionError:[WinError 5]访问被拒绝您是否安装了tesseract?尝试以管理员身份运行IDE不幸的是,它是my office膝上型电脑,没有可供我们使用的管理员权限,因此您对Anaconda文件没有权限我现在收到以下错误-文件C:\ProgramData\Anaconda3\lib\subprocess.py,第997行,在_execute_child startupinfo PermissionError:[WinError 5]访问被拒绝您是否安装了tesseract?尝试以管理员身份运行您的IDE不幸的是,它是我的办公室笔记本电脑,没有可供usso使用的管理员权限您没有对Anaconda文件的权限当我遇到此问题时,我重新安装了Pyteseract,并且它工作正常。有时候就这么简单。当我遇到这个问题时,我重新安装了pytesseract,它成功了。有时候就这么简单。
from PIL import Image
from tesseract import image_to_string

print(image_to_string(Image.open('marlboro.png'), lang='eng'))