user3156272
user3156272

Reputation: 33

Django- Not able to import the file

I am trying to import the python file Project/MasterCard/src/Gnip.py from the views.py

import sys
import os
import ConfigParser
from MasterCard.src 
import Gnip #  -- > Here i want to import the Gnip.py

Exception which occurred:

Exception Value:    No module named src

my directory structure

Upvotes: 1

Views: 71

Answers (2)

itzMEonTV
itzMEonTV

Reputation: 20339

Try this

create a __init__.py inside as MasterCard/src/__init__.py.Then import

from MasterCard.src import Gnip

Upvotes: 2

Ildar Musin
Ildar Musin

Reputation: 1468

Try adding __init__.py file to MasterCard/src/ directory.

Upvotes: 1

Related Questions