skip to Main Content

When i try to run main.py, this error appears: ModuleNotFoundError: No module named ‘catalog’

main.py

from catalog.config import config
from catalog.config.log_config import app_logging_config
from catalog.es_catalog_controller import EsCatalogController

@lru_cache()
def get_settings():
    return config.Settings()


catalog_controller = EsCatalogController()

It seems that vscode does not recognize the import of files inside catalog folder, but in pycharm it runs normally. What is needed to vscode recognizes this kind of import?

2

Answers


  1. make a virtual machine and then try. If u still get the error then u put the files in

    Login or Signup to reply.
  2. You can use shortcut "ctrl+shift+P" and choose the "python:select interpreter":

    enter image description here

    You can also click the option in the red box in the lower right corner to specify the python version:

    enter image description here

    After specifying the correct Python interpreter, install package by using command pip install catalog.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search