trying to import a specific file called environment.py
the issue is that I have this file in more than one location
the way i'm loading all my file variables (more than 20 variables in each file) is :
from environment import *
the thing is , I have the environment.py in 2 directories and my sys.path includes both of them. python loads the file from the first location in the list.
Tried
import os, sys, imp
path = os.path.dirname(os.path.abspath(__file__))
file = path + '/environment.py'
foo = imp.load_source('*',file)
But then my variables are loaded into foo and not directly.
Any ideas how to force import * from the right location
sys.pathto place the desired directory first before doing the import.import *.