On 7 July 2010 14:00, John Hunter <jdh2...@gmail.com> wrote: > On Wed, Jul 7, 2010 at 12:12 PM, Eric Firing <efir...@hawaii.edu> wrote: >> On 07/07/2010 04:25 AM, Angus McMorland wrote: >>> Hi all, >>> >>> I'm trying to install matplotlib from svn. I have two versions of >>> numpy on my computer: one installed by the Ubuntu package manager in >>> /usr/lib and one installed from source in /usr/local/lib which takes >>> precedence based on the order of my PYTHONPATH. I'm trying to install >>> the latest matplotlib from source, also into /usr/local using >>> >>> python setup.py install --prefix=/usr/local >>> >>> but mpl's setup.py appears to not use np.get_include() when working >>> out where to look for the numpy headers, so is finding the old ones in >>> /usr/lib. Is this the correct behaviour, and/or am I doing something >>> wrong? Is there another way to specify where the headers should be >>> found? >> >> I can't investigate properly right now, but get_include() is getting called: >> >> efir...@manini:~/programs/py/mpl/mpl_trunk$ grep get_include *.py >> setupext.py: module.include_dirs.append(numpy.get_include()) >> >> You could try putting in print statements to see what version of numpy >> has been imported at that point, and if it is the wrong one, how that >> comes about. When numpy is being imported for the first time in >> setupext.py, is PYTHONPATH what you think it is? > > That was my first thought -- when you call setup.py install are you > running as root. If so, it may not be picking up your userland > PYTHONPATH. Try adding the python path on the install line, eg > > PYTHONPATH=/usr/local/lib/python2.6/site-packages python setup.py > install --prefix=/usr/local
Thanks guys- that was exactly the problem: sudo not carrying PYTHONPATH through from userland. In case anyone's interested, I fixed it by adding Defaults env_keep+="PYTHONPATH" to my /etc/sudoers file, so the problem should now be permanently fixed. Sorry for the noise. Angus. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users