3

I faced this issue yesterday. I saw the following questions:
No module named pylab
python error: no module named pylab

Both of the above questions gave instructions for Linux and not for Windows machines.

The Problem
I have heard about the pylab package for plotting in python.
I opened the shell and tried this and...

>>> import pylab

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pylab
ImportError: No module named pylab

I then installed matplotlib and scipy but could not find the .exe file for numpy.

So, could someone
Please help me with installing pylab for python 2.7.

Community
  • 1
  • 1
IcyFlame
  • 5,059
  • 21
  • 50
  • 74

3 Answers3

10

You just need to install, matplotlib library and it will work fine. I had the same error but solved by that.

pip install matplotlib

dhilmathy
  • 2,800
  • 2
  • 21
  • 29
MwarukaSon
  • 297
  • 4
  • 9
2

There is just one step. Go to the following link and download the .msi file and then run it. It is a simple installation that installs a new EPD IDLE which comes enabled with numpy, scipy and pylab.

EPD Package

On this site you can download the .msi file. Registration is not required unless you want to update the packages. This IDLE is some version of Python 2.7.

IcyFlame
  • 5,059
  • 21
  • 50
  • 74
-2

If you just want to install pylab which comes under matplotlib package, and numpy & scipy in windows then you may uninstall the current ones(that don't work) from pip by command

 pip uninstall package_name

Then get the latest binary installer for numpy, scipy and matplotlib from here selecting your version of python and windows 32 or 64 bit. Then install it as normal software installer. Make sure it finds your version of python during the installation. This is it !!

After installation, type in the python shell

import matplotlib.pylab as plt
plt.plot([1,2,3])
plt.show()

This ensures that matplotlib is correctly installed on your machine!!

Santosh Ghimire
  • 3,087
  • 8
  • 35
  • 63