I get the following warning whenever running a script:
/usr/lib/pymodules/python2.6/mpl_toolkits/__init__.py:2: UserWarning: Module matplotlib was already imported from /usr/local/lib/python2.6/dist-packages/matplotlib/__init__.pyc, but /usr/lib/pymodules/python2.6 is being added to sys.path __import__('pkg_resources').declare_namespace(__name__)
Here is the imports section of the script:
from __future__ import division import csv from datetime import datetime, timedelta from random import random import numpy as np from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as Canvas from matplotlib.finance import candlestick, plot_day_summary from matplotlib.ticker import FuncFormatter from matplotlib.patches import Circle, Rectangle from matplotlib.lines import Line2D from mpl_toolkits.axes_grid import make_axes_locatable from mpl_toolkits.axes_grid.axes_size import AxesY from matplotlib.font_manager import FontProperties from mpl_toolkits.axes_grid.parasite_axes import SubplotHost from matplotlib import rcParams
What is causing the warning?
preguntado el 09 de marzo de 12 a las 13:03
The "problem" is with your installation of matplotlib - or rather, your two installations of it - not with the program you're trying to run.
From the message, I can infer that you have one version of matplotlib installed in /usr/local - perhaps a newer version that you installed yourself without using OS package management? - and another version in the OS standard location, /usr/lib/pymodules/python2.6.
The warning message tells you that Python notado the OS packaged version, but it is going to ignore it (ie, not load any modules from it) because it ya haya utilizado found the version in /usr/local and it can't make sense of having modules from two different directories.
If you meant to have two versions and you meant to be using the version in /usr/local, then the warning is essentially harmless to you.
If you didn't realize you have two versions of matplotlib installed, you might want to try to clean up that situation a bit.