I have a pure python module that will work for both Python 2.6 and 2.7. Instead of putting the module into the python version specific paths, is it possible to place the library at one location that will be accessed by both Python 2.6 and 2.7? System is Ubuntu.
Usually the Python library is located in the site-packages folder within the Python install directory, however, if it is not located in the site-packages folder and you are uncertain where it is installed, here is a Python sample to locate Python modules installed on your computer.
You can install the library in one location like /opt
and then create two soft links inside /usr/lib/python2.6
and /usr/lib/python2.7
pointing to that library.
By default, python26 searches for modules in /python2.6/ folders, while python27 looks in /python2.7/ folders.
One way to achieve your goal would be to add to system path another (common) location, by altering PYTHONPATH system variable:
export PYTHONPATH=/common/location
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With