I am running python 3.5.5 and have the following folder structure.
sgan/
scripts/
train.py
sgan/
losses.py
models.py
utils.py
data/
loader.py
trajectories.py
I am in folder ~/sgan
but when I ran python scripts/train.py
I get the error
Traceback (most recent call last):
File "./scripts/train.py", line 14, in <module>
from sgan.data.loader import data_loader
ImportError: No module named 'sgan'
What is the issue here ?
__init__.py
in each subdirectory – Sergiy Kolodyazhnyy Jul 23 '18 at 05:56__init__.py
file insgan/sgan/
andsgan/sgan/data/
so Python knows it's package.__init__.py
is definitely not for Python 2 only. – Timo Jul 23 '18 at 07:54