How to control python import order of module?

I am using Python 2.7 in Ubuntu 14.04. PyBluez module was installed in 2 locations. One location is /usr/lib/python2.7/dist-packages/bluetooth which comes from Ubuntu package. Another location is /usr/local/lib/python2.7/dist-packages/bluetooth which came from compiling the source code.

Suppose I want the import order to load the module in /usr/local/lib/ first, then /usr/lib/. How can this be done?

If possible, I would also like to know how this is done in Windows. If not, the solution in Ubuntu will be good enough.

How can one find out the current import order?


Source: ubuntu

Leave a Reply