Appending paths to Python's sys.path is pretty important if you are learning Python or testing some application in your local machine. If you append paths to sys.path by import sys and 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 file.
Just open your favourite text-editor with admin privileges (I did gksu gedit), and open /etc/python2.x/ 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
import sys

Done! Source: TheScripts To check if everything's done, restart the interpreter and run these commands:
import sys

And we will be greeted with the path you just added. ;)

Labels: ,

blog comments powered by Disqus