IcyFlame
IcyFlame

Reputation: 5199

no module named pylab on windows

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.

Upvotes: 4

Views: 24760

Answers (3)

MwarukaSon
MwarukaSon

Reputation: 377

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

pip install matplotlib

Upvotes: 11

Santosh Ghimire
Santosh Ghimire

Reputation: 3145

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!!

Upvotes: -2

IcyFlame
IcyFlame

Reputation: 5199

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.

Upvotes: 2

Related Questions