Pytesseract, MacOS, VScode: Issue with using tesseract despite it seemingly being downloaded

I’m new to python and coding, and I am writing a piece of code to take a look at a ruler’s numbers using pytesseract. Here’s a short snippet of code including everything relevant to my issue:

import pytesseract as tess 

*#Pytesseract is highlighted as something that hasn't properly been imported*

raw_ruler = print(tess.image_to_string(gray_test_image)) #Assume gray_test_image is a processed photo

lines = raw_ruler.strip().split('n')
numbers = [int(line) for line in lines]

first_number = numbers[0]

inch_range = last_number - first_number


image_width_pixels = 4240 

ppi_width = image_width_pixels/inch_range
pixel_range = ppi_width * inch_range

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pytesseract/pytesseract.py:255, in run_tesseract(input_filename, output_filename_base, extension, lang, config, nice, timeout)
    254 try:
--> 255     proc = subprocess.Popen(cmd_args, **subprocess_args())
    256 except OSError as e:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py:1026, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
   1023             self.stderr = io.TextIOWrapper(self.stderr,
   1024                     encoding=encoding, errors=errors)
-> 1026     self._execute_child(args, executable, preexec_fn, close_fds,
   1027                         pass_fds, cwd, env,
   1028                         startupinfo, creationflags, shell,
   1029                         p2cread, p2cwrite,
   1030                         c2pread, c2pwrite,
   1031                         errread, errwrite,
   1032                         restore_signals,
   1033                         gid, gids, uid, umask,
   1034                         start_new_session, process_group)
   1035 except:
   1036     # Cleanup if the child failed starting.

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py:1955, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)
   1954 if err_filename is not None:
-> 1955     raise child_exception_type(errno_num, err_msg, err_filename)
...
--> 260         raise TesseractNotFoundError()
    262 with timeout_manager(proc, timeout) as error_string:
    263     if proc.returncode:

TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.

I have verified that pytesseract is installed via homebrew:

$ brew reinstall tesseract
==> Downloading https://ghcr.io/v2/homebrew/core/tesseract/manifests/5.4.1
Already downloaded: /Users/4494177/Library/Caches/Homebrew/downloads/90a14ece96dee96d869e7eb9be23351b2da94395dbf347f386a130f23cfe1ac8--tesseract-5.4.1.bottle_manifest.json
==> Fetching tesseract
==> Downloading https://ghcr.io/v2/homebrew/core/tesseract/blobs/sha256:41f0427b
Already downloaded: /Users/4494177/Library/Caches/Homebrew/downloads/253884c99fb6de00e50b5d6e48e23e3545556f09d9e2f05eea46a090164375c8--tesseract--5.4.1.arm64_sonoma.bottle.tar.gz
==> Reinstalling tesseract 
==> Pouring tesseract--5.4.1.arm64_sonoma.bottle.tar.gz
==> Caveats
This formula contains only the "eng", "osd", and "snum" language data files.
If you need any other supported languages, run `brew install tesseract-lang`.
==> Summary
????  /opt/homebrew/Cellar/tesseract/5.4.1: 75 files, 33MB
==> Running `brew cleanup tesseract`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

I’ve been stuck with this issue for a while, and help would be greatly appreciated!

I’ve tried looking at the path, and have had trouble knowing exactly what that means, I’ve looked up how to verify it via command terminal, and sometimes I get positive results, other times nothing is outputted.

New contributor

Quinten Neudorf Boosters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật