0

I have a folder called 'x'. Inside this folder I have a __main__.py file. In this file I have from x import xapi. 'xapi.py' is in the folder 'x'.

When I type on the terminal pipenv run start, I get an error: No module named 'x'

I tried changing from x import xapi to from . import xapi and import xapi. It didn't work either.

How can I fix it?

Ana Claudia
  • 501
  • 6
  • 16
  • 1
    Check this out: https://stackoverflow.com/questions/4383571/importing-files-from-different-folder – Avinash Apr 28 '22 at 13:20
  • https://stackoverflow.com/questions/4142151/how-to-import-the-class-within-the-same-directory-or-sub-directory – Avinash Apr 28 '22 at 13:25

0 Answers0