I have the following directory structure:
Master -------Tests |-----------test_extract.py -------Scripts |-----------extract.py This I'm trying to do a unit test file for extract.py. However, I'm receiving the following error:
"not {}".format(type(path)))
RuntimeError: 'path' must be None or a list, not >'_frozen_importlib_external._NamespacePath'>
This is how I'm trying to import the extract module:
import unittest import sys print (sys.path[0]) sys.path.insert(0, sys.path[0]+'\\Scripts') from Scripts import extract I'm using Python 3.5. Please advice.
Thanks
sys.path.insert(0, sys.path[0]+'\\Scripts')? Did you try just import packege to test module?