0

So, this is my project tree:

|--project
|  |--script.py
|  |--Module/
|  |  |--__init__.py
|  |  |--src/
|  |  |  |--__init__.py
|  |  |  |--cell.py ==> class Cell
|  |  |  |--map.py  ==> class Map
|  |  |--test/
|  |  |  |--__init__.py
|  |  |  |--test.py 

I'm having problems to import Map and Cell classes from test.py

I have tried using:

from Module.src.map import Map
from .src.map import Map

and neither of those works, any idea on how to import in this case and why the two latest import statements doesn't work?

  • You should try just `from Module import Map` – Gugu72 Oct 14 '19 at 17:46
  • Possible duplicate of [How to import the class within the same directory or sub directory?](https://stackoverflow.com/questions/4142151/how-to-import-the-class-within-the-same-directory-or-sub-directory) – tafaust Oct 14 '19 at 17:51

0 Answers0