2

I just upgraded to python3 on Fedora, and was trying to import pylab. But instead I got an error

ImportError: No module named 'pylab'

After some research I found some information about installing a package matplotlib-py3k to make it work. However, the link to the page is down! Maybe there is a yum install package I can use to simply install pylab to work with python3?

The package for python2.x is installed and working.

Community
  • 1
  • 1
Alex
  • 41,580
  • 88
  • 260
  • 469

2 Answers2

0

Try yum install python-matplotlib. If I am mistaken, then you can try from the source.

From the matplotlib website...

If you are on Fedora/RedHat, you can get all the dependencies required to build matplotlib by first installing yum-builddep and then running: su -c "yum-builddep python-matplotlib" This does not build matplotlib, but it does get all of the build dependencies, which will make building from source easier.

Then you can use git clone git@github.com:matplotlib/matplotlib.git to git matplotlib and then install with cd matplotlib and python setup.py install.

CoffeeRain
  • 4,460
  • 4
  • 31
  • 50
  • I just tried `yum install python-matplotlib`. Something was installed, but I get the same error again. Maybe I have to change the installed pylab from version 2 to 3, change path, add path, remove old installation, type something else, ...? – Alex Dec 11 '12 at 21:43
  • Did you try the second part to do if the `yum install` didn't work? – CoffeeRain Dec 12 '12 at 15:10
0

You need to install matplotlib for python3 by performing:

yum install python3-matplotlib
PaulS
  • 334
  • 2
  • 11