Traceback (most recent call last): File "D:\py\lib\site-packages\pytesseract\pytesseract.py", line 255, in run_tesseract proc = subprocess.Popen(cmd_args, **subprocess_args()) File "D:\Python37\lib\subprocess.py", line 800, in init restore_signals, start_new_session) File "D:\Python37\lib\subprocess.py", line 1207, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\pythonProject\test3.py", line 21, in <module> subtitle_text = pytesseract.image_to_string(subtitle_region, config=config) File "D:\py\lib\site-packages\pytesseract\pytesseract.py", line 427, in image_to_string }output_type File "D:\py\lib\site-packages\pytesseract\pytesseract.py", line 426, in <lambda> Output.STRING: lambda: run_and_get_output(*args), File "D:\py\lib\site-packages\pytesseract\pytesseract.py", line 288, in run_and_get_output run_tesseract(**kwargs) File "D:\py\lib\site-packages\pytesseract\pytesseract.py", line 260, in run_tesseract raise TesseractNotFoundError() pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.刚刚你修改后报这个错误
时间: 2023-08-07 21:02:31 浏览: 284
这个错误提示是说找不到安装的 OCR 引擎 Tesseract 或者 Tesseract 没有在你的环境变量 PATH 中。为了解决这个问题,你需要安装 Tesseract 并将其添加到 PATH 中。你可以从以下链接下载 Tesseract:https://github.com/UB-Mannheim/tesseract/wiki。安装完成后,将 Tesseract 的安装路径添加到 PATH 中即可。
相关问题
Traceback (most recent call last): File "D:\2212406121017fzh\main.py", line 6, in <module> html = requests.get(url,headers=header) File "D:\Anaconda3\lib\site-packages\requests\api.py", line 73, in get return request("get", url, params=params, **kwargs) File "D:\Anaconda3\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "D:\Anaconda3\lib\site-packages\requests\sessions.py", line 573, in request prep = self.prepare_request(req) File "D:\Anaconda3\lib\site-packages\requests\sessions.py", line 484, in prepare_request p.prepare( File "D:\Anaconda3\lib\site-packages\requests\models.py", line 369, in prepare self.prepare_headers(headers) File "D:\Anaconda3\lib\site-packages\requests\models.py", line 489, in prepare_headers for header in headers.items(): AttributeError: 'set' object has no attribute 'items' 进程已结束,退出代码1
根据您提供的信息,看起来是您在使用requests库时出现了错误。根据错误信息,代码中的headers应该是一个set对象,而不是一个dict对象,所以出现了'AttributeError: 'set' object has no attribute 'items''的错误。
您可以尝试将headers改为一个dict对象,例如:
```python
import requests
url = 'http://example.com/api'
headers = {'User-Agent': 'Mozilla/5.0'}
response = requests.get(url, headers=headers)
print(response.text)
```
在这个例子中,我们使用了一个包含User-Agent头的headers字典。请确保headers是一个dict对象,并且您的请求URL有效。
Traceback (most recent call last): File "D:\Python38\lib\site-packages\pytools\__init__.py", line 44, in <module> from typing import SupportsIndex, Concatenate ImportError: cannot import name 'Concatenate' from 'typing' (D:\Python38\lib\typing.py) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<pyshell#23>", line 1, in <module> from pycuda.compiler import SourceModule File "D:\Python38\lib\site-packages\pycuda\compiler.py", line 1, in <module> from pytools import memoize File "D:\Python38\lib\site-packages\pytools\__init__.py", line 46, in <module> from typing_extensions import SupportsIndex, Concatenate ImportError: cannot import name 'Concatenate' from 'typing_extensions' (D:\Python38\lib\site-packages\typing_extensions.py)
如果出现 `ImportError: cannot import name 'Concatenate' from 'typing'` 错误,可能是因为 PyCUDA 依赖的 `typing` 模块版本过低所致。可以尝试更新 `typing` 模块或者升级 Python 到最新版本。另外,也可以尝试升级 PyCUDA 到最新版本,最新版本的 PyCUDA 已经支持 Python 3.9。
阅读全文