I want to execute a python file where I want to check if there are new rows in a csv file. If there are new rows, I want to add them to a database.

The project tree is as follows:

[![enter image description here](https://i.stack.imgur.com/cA0ra.png)](https://i.stack.imgur.com/cA0ra.png)

Thus, the file which I want to execute is `check_relations.py` inside `relations` folder.

`check_relations.py` is as follows:

```
from master.models import TraxioRelations

with open('AUTOI_Relaties.csv', 'rb') as tr:
    traxio_relations = tr.readlines()

for line in traxio_relations:
    number = line.split(';')[0]
    number_exists = TraxioRelations.objects.filter(number=number)
    print(number_exists)

```

The model `TraxioRelations` is inside `models.py` in `master` folder.

When I run `python check_relations.py` I get an error 

```
Traceback (most recent call last):
  File "check_relations.py", line 3, in <module>
    from master.models import TraxioRelations
ImportError: No module named master.models

```

What am I doing wrong? How can I import model inside check\_relations.py file?