Making sure you're using a correct interpreter will allow you to import third-party packages installed for that interpreter.
However, if you're trying to lookup a definition for your own module, make sure your PYTHONPATH
is set correctly and that you have an empty __init__.py
inside your module.
Let's say your module is defined inside
[project_root]/src/my_library
Your PYTHONPATH
defined in .env
file (located in the project root) should contain:
PYTHONPATH=$PYTHONPATH:./src
(note that, in Windows, the separator is ;
and not :
). Also, make sure you have created the file [project_root]/src/my_library/__init__.py