0

I have problem to use modules from one package to another. I have tried existing solution, but unfortunately i could not resolve my issue. This is my directory structure

--asag
-----Resources
-----grader
      __init__.py  (empty)
      features.py
-----align 
      config.py
      util.py
      wordsim.py
      __init__.py (empty)

Now I want to import modules of align package inside grader package. So inside my features.py, I have written:

from ..align import *

But i get error:

  File "features.py", line 6, in <module>
  from ..align import *
  ValueError: Attempted relative import in non-package

Can anyone tell me, what is wrong?

Thanks

Lucky
  • 875
  • 1
  • 9
  • 19

1 Answers1

0

It's because it's a module. You should run it like

python -m asag.grader.features

See this answer for more: How to fix "Attempted relative import in non-package" even with __init__.py

MichaelB
  • 1,092
  • 2
  • 16
  • 32