Невозможно выполнить код в коде VS с python версии 3.8.1: - Возникает ошибка ниже в терминале
pdftojpg.py
import os
import tempfile
#import cv2
from pdf2image import convert_from_path
filename = 'E:/djcodes/pyproject/ID.pdf'
with tempfile.TemporaryDirectory() as path:
images_from_path = convert_from_path(filename, output_folder=path, last_page=1, first_page =0)
base_filename = os.path.splitext(os.path.basename(filename))[0] + '.jpg'
save_dir = 'E:/djcodes/pyproject/image'
for page in images_from_path:
page.save(os.path.join(save_dir, base_filename), 'JPEG')
#img = cv2.imread(save_dir+os.path.splitext(os.path.basename(filename))[0]+'jpeg')
Ошибка терминала: -
Traceback (most recent call last):
File "c:\Users\asus\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\ptvsd_launcher.py", line 48, in <module>
main(ptvsdArgs)
File "c:\Users\asus\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 432, in main
run()
File "c:\Users\asus\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 300, in run_file
setup_connection()
File "c:\Users\asus\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 288, in setup_connection
if not daemon.wait_for_launch(addr):
File "c:\Users\asus\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\runner.py", line 61, in wait_for_launch
_, start_session = self.start_client(addr)
File "c:\Users\asus\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\daemon.py", line 217, in start_client
connect(client, addr)
File "c:\Users\asus\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\socket.py", line 197, in connect
sock.connect(addr)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
Пожалуйста, помогите решить проблему