Reputation: 437
I'm running Python 2.7 in my Ubuntu 16.0. I have created a folder Scripts & put 2 files,
config.py & init.py
, inside that folder. Also I have added in updated .bashrc pythonpath using following statement
export PYTHONPATH=$PYTHONPATH:path to my script folder
But while I'm ruining from Scripts import test
I'm getting error message ImportError: No module named 'Scripts'
Can you please suggest me the solution?
Upvotes: 0
Views: 3480
Reputation: 1943
Where is your module placed ? You have to add the folder where your module present to sys path. You can do that by adding below lines in your python file
import sys
sys.path.append("/path/to/your/module")
Upvotes: 2