I'm building a python project in VS2015. This project has several files in different folders.For example file settings.py
in folder config
. I have a main.py
file in folder bin
. In main.py
I need to import settings.py
. This is what I'm doing in main.py
:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from pygame.locals import *
import os
print(os.getcwd()) #check if the working directory is right
from config.settings import *
However, when I run the project, I get this Error:No module named 'config'
. But if I enter from config.settings import *
in the interactive window, there is no Error comes out. I'm sure folder config
is under print(os.getcwd())
. Why this happened? How can I solve it?