 <p>The simplest way is to use <a href="https://docs.python.org/2/library/sys.html#sys.path" rel="nofollow">sys.path</a> to make sure that you will have right order of paths added. <code>sys.path</code> gives out the list of paths that are available in the <code>PYHTONPATH</code> environment variable with the right order. If you want any path to have higher priority over others, just add it to the beginning of the list.</p> <p>And you will also find this in the official docs:</p> <blockquote> <p>A program is free to modify this list for its own purposes.</p> </blockquote> <p>WARNING: Even though this gives better control over the priority, just make sure that whatever library you add does not mess with the system libraries. Else, your library will be searched first, as it is in the beginning of the list, and they may replace the system libraries. Just as an example, if you have written a library by the name <code>os</code>, after adding this to the <code>sys.path</code>, that library will be imported instead of Python's in-built. So take all the caution and also with a large amount of salt before jumping to this.</p>