Search code examples
pythonpycharmpython-tesseract

Pycharm not finding common modules


I'm unable to import modules in pycharm, however i am easily able to do it via the cmd (after i've typed) python and via the python console in Pycharm as well. I am using python 2.7 and python.exe is in my PATH.

In Pycharm when i go into setting and look at the interpreter i can clearly see the module (pytesseract)

I am using pycharm 2018.3.2

Here are the images.

https://i.sstatic.net/czTUC.jpg


Solution

  • There are 2 ways that PyCharm will reference a python interpreter, and you have to make sure they are both configured correctly. They perform different functions, and do so independently of one another.

    The first place is in 'File=>Settings=>Project:x=>Project Interpreter'. PyCharm will use the interpreter (ie: python environment) you select here to analyze your code within the IDE.

    Project Interpreter

    Project Interpreters

    The second place is in Run/Debug Configurations. This allows you to specify multiple configurations for running your project. Each configuration can specify a different python interpreter for running / debugging your code. Each configuration you create will add a corresponding option to the dropdown in the main interface.

    Run / Debug Configurations

    Creating & Editing Run Debug Configurations