mcchucklezz
mcchucklezz

Reputation: 376

PyLab does not have any attrs

I am working with PyBrain and in the documentation it uses PyLab... I try importing PyLab and that works, however when I try using any of the modules in it python returns an error.

    >>> import pylab
    >>> dir(pylab)
    ['__author__', '__builtins__', '__doc__', '__email__', '__file__',   '__name__', '__package__', '__path__', '__version__']
    >>> 

PyLab appears to be installed correctly but it doesn't have any contents.

Upvotes: 3

Views: 173

Answers (1)

zmo
zmo

Reputation: 24812

There are many reasons why that happen… So let's find out what's happening.

The PyLab you've installed is very likely the one from pypi:

which is actually the one here:

and when you look at the files, it's matching what you're saying:

it's quite empty ☺

Though, if you install it, it's gonna install you a lot of dependencies for scientific development:

Though, since you've installed the pylab package, you've got matplotlib installed, and thus you can use the pylab which is actually part of matplotlib:

So if you do from matplotlib.pylab import * you should get started!

HTH

Upvotes: 2

Related Questions