Appending paths to Python's
sys.pathis pretty important if you are learning Python or testing some application in your local machine. If you append paths to sys.path by
sys.path.append("/path/")it will only be temporary: once you restart the interpreter it won't work anymore. A permanent solution is editing the site.py file.
Just open your favourite text-editor with admin privileges (I did gksu gedit), and open /etc/python2.x/site.pysite.py is the file that python interpreter looks up when it is invoked file. (2.x is the Python version) Now, add these two lines to site.py:
Done! Source: TheScripts To check if everything's done, restart the interpreter and run these commands:
And we will be greeted with the path you just added. ;)