Answer the question
In order to leave comments, you need to log in
Why are the modules inside the package not visible?
Hello! Faced strange behavior of pylint in microsoft visual studio code. Directory structure:
test\
a.py
b.py
c.py
import b
import c
def test():
b.say()
c.say()
if __name__ == "__main__":
test()
File "/test_bot.py", line 29, in <module>
import test.a as test
File "/test/a.py", line 1, in <module>
import b
ModuleNotFoundError: No module named 'b'
Answer the question
In order to leave comments, you need to log in
Found a solution, but maybe it's a crutch
if __name__ == "__main__":
import b
import c
else:
from test import b
from test import c
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question