Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I can't seem to find documentation on this. Matplotlib says to run:

sudo yum install python-matplotlib

which installs all the dependancies and this version of matplotlib successfully:

python-matplotlib.x86_64 0:0.99.1.2-1.6.amzn1

However, I use python2.7, separately installed. The original (and still existing) python2.6 now imports matplotlib successfully. Is there a related matplotlib package on RedHat for python2.7?

Other info:

  • which python2.6 returns /usr/bin/python2.6
  • which python returns /usr/bin/python.
  • cat /proc/version returns
    Linux version 3.14.23-22.44.amzn1.x86_64 ... (Red Hat 4.8.2-16) (GCC) ...
share|improve this question
    
If there isn't just install with pip (assuming you have that installed for 2.7 ) –  Anthon Mar 11 at 19:55

1 Answer 1

up vote 0 down vote accepted

I built from source. :( Surprisingly not that difficult, but ran into a lot of problems doing the interactive part (Redhat 4 is too old to have packages for most things that let you do interactive backends, I need a newer machine).

# get matplotlib
wget https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.4.3/matplotlib-1.4.3.tar.gz

#uncompress
tar xvzf matplotlib-1.4.3.tar.gz

# open build install
# read INSTALL file for more instructions
cd matplotlib-1.4.3
python setup.py build
# actually installing needed superuser privileges
sudo python setup.py install

Hope this saves time for anyone else with a similar setup.


NOTE:

I tried what @Anthon said to do! but it didn't work very well because of the age of my OS? pip assumes some things that didn't work well for some annoying reason. I tried to use pip2.7 instead, installed all the required dependencies, and it broke on this issue concerning permissions. The solution is to reset the permissions of the problem file with:

chmod o+x /path/to/file

However, it's a temporary copied file. :( During the install of matplotlib it recopies this file over, so I can't set permissions on it. Here is the place it is broken:

g++ ... -lpython2.7 -o build/lib.linux-x86_64-2.7/matplotlib/backends/_backend_agg.so
running install_lib
copying pylab.py -> /usr/lib64/python2.7/site-packages
error: [Errno 13] Permission denied: '/usr/lib64/python2.7/site-packages/pylab.py'

This doesn't seem like the right way to do it, it's too cobbled together. Final solution to avoid all this is the start of this answer.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.