I'm trying to import a module named pytesseract into a Python file in a package I made. However, I get a No Module Found error. The same error doesn't occur for numpy, and I noticed that numpy was in the requirements.txt file. My thinking is that I would have to add pytesseract to a file like CMakeLists or package.xml. What am I actually supposed to do?
When a python module/package is failing to be imported into ros, it is most-likely an issue with which python: which python is ros using, and which one you used to install. Normally, of course, you would make a special env for your python project, specifying the version, but ros strongly prefers to use system level definitions. And (before ubuntu 20) strictly preferred python 2. (Since/if/when ros is the only project using system python, this works out fine for other projects).
Ros executables (python scripts) use whichever shebang you give it, or whichever python is set as default; you can try running that (python2) terminal outside of ros and attempt importing to narrow the cause. importing ros packages will fail if you use the wrong python; likewise, if you pip3/pip install a python3 package, importing it in python2 will fail (due to default python_path settings).