0

I am trying to import a class named DataHandler into my test_data_handler file. I am doing this by stating from handles.data_handler import DataHandler. However, when I do this I get a error saying

No module named 'handles'

If anyone knows how to get round this issue it would be greatly appreciated!

enter image description here

user17976264
  • 25
  • 1
  • 5

1 Answers1

0

You need add __init__.py file inside folder handles. The __init__.py file lets the Python interpreter know that a directory contains code for a Python module.

import sys
sys.path.insert(1, '/path/to/application/app/folder')
from handles.data_handler import DataHandler

Importing files from different folder

tafer
  • 79
  • 5