I've installed most of my modules through Ubuntu packages, and consequently they're in /usr/lib/python3/dist-packages
. Some are too old or not available through Ubuntu, so I've installed them through pip, and they're in /usr/local/lib/python3.3/dist-packages
.
So far so good. However, both contain a package mpl_toolkits
, but with different contents. import mpl_toolkits.basemap
fails despite the presence of /usr/local/lib/python3.3/dist-packages/mpl_toolkits/basemap
, because mpl_toolkits
is found first in /usr/lib/python3/dist-packages/mpl_toolkits
, which contains a number of modules, but not basemap
.
So, in effect, the distribution-level mpl_toolkits
is shadowing custom-installed mpl_toolkits
. What is a correct way of handling this?