0

May someone explain why when I when I use sys.path.append I cannot access to my module via structure "from somefolder import module"?

import sys

sys.path.append('../models/research/object_detection/utils')


import dataset_util

cannot import name 'dataset_util'

whilst - from utils import dataset_util works fine

Is there any decent explanation of this behavior? And what should I do with sys.path.append to have ability to use the structure "from somefolder import module"? Thanks in advance

Ivan Shelonik
  • 1,958
  • 5
  • 25
  • 49
  • I believe you need to use absolute paths for `sys.path`s. – r.ook Jan 30 '18 at 17:28
  • Possible duplicate of [Python: Best way to add to sys.path relative to the current running script](https://stackoverflow.com/questions/8663076/python-best-way-to-add-to-sys-path-relative-to-the-current-running-script) – r.ook Jan 30 '18 at 17:30

0 Answers0