1

My project structure:

Project structure

Now In XMLHelper.py file under the Utility package i have the below import:

from ..Common import BaseScreen

From Pycharm I right click the ResultSettingScreen.py to run the script.

I get error below

/usr/bin/python3.8 xxxx/src/FiveInch/800x480/ResultSettingScreen.py
Traceback (most recent call last):
  File "xxxx/src/FiveInch/800x480/ResultSettingScreen.py", line 22, in <module>
    from Utility import XMLHelper
  File "xxxx/src/FiveInch/800x480/Utility/XMLHelper.py", line 5, in <module>
    from ..Common import BaseScreen
ValueError: attempted relative import beyond top-level package
Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
BizBaker
  • 13
  • 4
  • Have you seen [this question](https://stackoverflow.com/questions/30669474/beyond-top-level-package-error-in-relative-import)? – meti Nov 01 '21 at 11:37
  • 1
    Does this answer your question? [beyond top level package error in relative import](https://stackoverflow.com/questions/30669474/beyond-top-level-package-error-in-relative-import) – Manuel Fedele Nov 01 '21 at 12:19

0 Answers0