cannot import pylab

1,225 views
Skip to first unread message

rob-neuro

unread,
Nov 12, 2010, 10:50:22 PM11/12/10
to Brian
Hi - I was able to get brian running properly on eclipse and getting
a display of plots. However, when I re-installed everything on a
different
disk partition I can no longer import pylab. I removed the old
versions of pylab etc. using the control panel in win XP Pro before
installing on a different partition.
.
The packages that I have loaded are: python-2.6.6,numpy-1.3.0-win32-
superpack-python2.6,
scipy-0.7.1-win32-superpack-python2.6, sympy-0.6.7.win32,
matplotlib-1.0.0.win32-py2.6,
brian-1.2.1.win32.
The error message in the python window when the command
"brian_sample_run()" is
entered is shown below.

Traceback (most recent call last):
File "<stdin>", line1, in <module>
File "E:¥Python26¥lib¥site-packages¥brian¥tests¥simpletest.py", line
26, in brian_sample_run
raster_plot(M)
File "E:¥Python26¥lib¥site-packages¥brian¥plotting.py" , line 188, in
raster_plot
line, = pylab.plot(st,sn,'.', **plotoptions)
NameError: global name 'pylab' is not defined

Please let me know what I have done wrong. Does the problem have to
do with the version of some software I have installed ? I have loaded
the same software versions
on a different PC running Win7 and have had no problems.
Thank you.
Robert

Dan Goodman

unread,
Nov 15, 2010, 1:58:46 PM11/15/10
to brians...@googlegroups.com
Hi,

Not sure what the problem is here, but since it seems to be a
Python/matplotlib issue you might have more luck on one of their support
lists. Some suggestions though:

If you open a Python or IPython console, and type "import pylab" does it
work? Are you sure that the old versions were properly and completely
removed? Check that the C:\Python26 folder is completely gone. Also
check that there are no environment variables that point to C:\Python26.
Maybe also search the registry for things pointing to C:\Python26.

Dan

robert fujii

unread,
Nov 16, 2010, 1:06:41 PM11/16/10
to brians...@googlegroups.com

Hi Dan,
Thank you for your suggestions.  I tried all your suggestions including
checking environment variables and clearing registry entries pertaining to python.
The traceback  messages  below show a memory error when I execute "import pylab".
Thank you.
Robert

 import pylab
  File "F:\Python26\lib\site-packages\pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "F:\Python26\lib\site-packages\matplotlib\pylab.py", line 206, in <module>
    from matplotlib import mpl  # pulls in most modules
  File "F:\Python26\lib\site-packages\matplotlib\mpl.py", line 2, in <module>
    from matplotlib import axis
  File "F:\Python26\lib\site-packages\matplotlib\axis.py", line 10, in <module>
    import matplotlib.font_manager as font_manager
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 1301, in <module>
    _rebuild()
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 1292, in _rebuild
    fontManager = FontManager()
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 984, in __init__
    self.ttffiles = findSystemFonts(paths) + findSystemFonts()
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 330, in findSystemFonts
    for f in win32InstalledFonts(fontdir):
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 213, in win32InstalledFonts
    key, direc, any = _winreg.EnumValue( local, j)
MemoryError

Dan Goodman

unread,
Nov 16, 2010, 1:16:43 PM11/16/10
to brians...@googlegroups.com
Hi Robert,

Ah OK, in that case I have no idea what the problem is. I suggest asking
on the matplotlib-users mailing list:

http://sourceforge.net/mailarchive/forum.php?forum_name=matplotlib-users

Dan

> --
> You received this message because you are subscribed to the Google
> Groups "Brian" group.
> To post to this group, send email to brians...@googlegroups.com.
> To unsubscribe from this group, send email to
> briansupport...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/briansupport?hl=en.

Yaroslav Halchenko

unread,
Nov 16, 2010, 1:35:36 PM11/16/10
to brians...@googlegroups.com
Pardon my interception,

alternatively, since brian is in NeuroDebian already you could give a
try to our virtual machine:
http://neuro.debian.net/vm.html

there you should be able to install brian in a matter of seconds ;)

Cheers,

On Wed, 17 Nov 2010, robert fujii wrote:

> Hi Dan,
> Thank you for your suggestions. I tried all your suggestions including
> checking environment variables and clearing registry entries pertaining to
> python.
> The traceback messages below show a memory error when I execute "import
> pylab".
> Thank you.
> Robert

--
.-.
=------------------------------ /v\ ----------------------------=
Keep in touch // \\ (yoh@|www.)onerussian.com
Yaroslav Halchenko /( )\ ICQ#: 60653192
Linux User ^^-^^ [175555]


Reply all
Reply to author
Forward
0 new messages