(GPS & MySQL) No module error in python 2.7 with virtualenv running on Lubuntu
Question: I have installed the gps packages and the mysql packages using : sudo apt-get
install gpsd gpsd-clients sudo dpkg-reconfigure gpsd & sudo apt-get install
python2.7-mysqldb it shows that the packages have been successfully installed
but when i run my python code which has :

    
    
    import gps 
    import MySQLdb as mdb
    error comes:
    ImportError: No module named gps
    and ImportError: No module named MySQLdb
    in python sys.path gives the following:
    sys.path
    ['', '/home/odroid/.virtualenvs/barc/src/django-tastypie-master', '/home/odroid/barc/workspace/devel/lib/python2.7/dist-packages', '/opt/ros/indigo/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/site-packages', '/home/odroid/.virtualenvs/barc/lib/python2.7', '/home/odroid/.virtualenvs/barc/lib/python2.7/plat-arm-linux-gnueabihf', '/home/odroid/.virtualenvs/barc/lib/python2.7/lib-tk', '/home/odroid/.virtualenvs/barc/lib/python2.7/lib-old', '/home/odroid/.virtualenvs/barc/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/home/odroid/.virtualenvs/barc/local/lib/python2.7/site-packages', '/home/odroid/.virtualenvs/barc/lib/python2.7/site-packages']
    


Answer: % SOLVED, if python is running in a virtual env then there is a issue with the
path of the modules. need to change path :

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages % this command
has to be made everytime the terminal window is closed and for permanently
implementing this change// source vim .bashrc % copy //export
PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages % and then source
.bashrc

