I have a python program that starts with:
from optparse import OptionParser
import math
#import wx
import os
import numpy as np
import matplotlib.pyplot as plt
from pylab import *
from numpy import *
import scipy as scipy
from scipy import *
from scipy import constants
import scipy.signal as signal
import matplotlib.pyplot as plt
It gives me error when I try to open it with php. I have googled and apparently if I do this before importing pylab or pyplot:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
Problem should be solved. But the error I get is:
/usr/lib/pymodules/python2.7/matplotlib/__init__.py:923: UserWarning: This call to matplotlib.use() has no effect
because the the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time
Any idea what's going on??