I have a python package dateutil in the ~/.local/lib/python2.7/site-packages directory as well as one in /usr/lib/python2.7/dist-packages/dateutil. When I try to run an executable from kalibr (a camera calibration tool, I downloaded the CDE), rrule.py from the dateutil package in ~/.local/lib/python2.7/site-packages throws an error "ImportError: No module named fractions". I can get kalibr running, by removing said dateutil package (s.t. it uses the one in /usr/lib/python2.7/dist-packages/dateutil) but I fear that this will have some implications on other projects.
So I figured that the basic problem here is that python prefers the dateutil package in ~/.local/lib/python2.7/site-packages over the one in /usr/lib/python2.7/dist-packages/dateutil.
How can I make python prefer the latter one?
(I am using Ubuntu 16.04)
See the answers here about changing the
PYTHONPATHand the default module search order. You should also check your script to see if it modifies eitherPYTHONPATHorsys.path.