problem with import pylab

Thanks. I ran the Simple Hello World program (section 25.1.2.2 at http://docs.python.org/library/tkinter.html) without any problem, so I guess Tk installation itself is ok.

Someone has experience with getting matplotlib work with Tk?

···

— On Sun, 1/17/10, Erik Tollerud <erik.tollerud@…83…287…> wrote:

From: Erik Tollerud <erik.tollerud@…287…>
Subject: Re: [Matplotlib-users] problem with import pylab
To: “H L” <hulu800@…9…>
Date: Sunday, January 17, 2010, 9:18 PM

Just based on the traceback, the problem seems to be in Tk - does anything in tk work for you? (e.g. any of the builtin python gui stuff) You might try installing wx and changing your matplotlibrc file to have the line “backend:WxAgg” in it. I’ve never tried using the wx backend on windows (anyone done this?), but presumably it should work…

On Fri, Jan 15, 2010 at 5:47 PM, H L <hulu800@…9…> wrote:

Hello:

I am having problem with “import pylab”. I attached the traceback below. I have googled on the web but haven’t found a solution. Can someone here help?

I have ActivePython 2.5, numpy-1.4.0-win32, and matplotlib-0.99.1.win32-py2.5.exe, and Windows XP SP3.


Traceback (most recent call last):
File “”, line 1, in
File “C:\Python25\lib\site-packages\pylab.py”, line 1, in
from matplotlib.pylab import *
File “C:\Python25\lib\site-packages\matplotlib\pylab.py”, line 247, in
from matplotlib.pyplot import *
File “C:\Python25\lib\site-packages\matplotlib\pyplot.py”, line 78, in
new_figure_manager, draw_if_interactive, show = pylab_setup()
File “C:\Python25\lib\site-packages\matplotlib\backends_init_.py”, line 25, in pylab_setup
globals(),locals(),[backend_name])
File “C:\Python25\lib\site-packages\matplotlib\backends\backend_tkagg.py”, line 8, in
import
tkagg # Paint image to Tk photo blitter extension
File “C:\Python25\lib\site-packages\matplotlib\backends\tkagg.py”, line 1, in
import _tkagg
ImportError: DLL load failed: The specified module could not be found.

Thanks.

HL


Throughout its 18-year history, RSA Conference consistently attracts the
world’s best and brightest in the field, creating opportunities for Conference
attendees to learn about information security’s most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

The extension _TKAGG.PYD depends on TK84.DLL, TCL84.DLL, MSVCP71.DLL, and MSVCR71.DLL. Make sure all these files are located in the Windows search path, e.g. in one of the directories listed in the PATH environment variable.

Christoph

···

On 1/18/2010 1:45 PM, H L wrote:

Thanks. I ran the Simple Hello World program (section 25.1.2.2 at
tkinter — Python interface to Tcl/Tk — Python 3.12.0 documentation) without any problem, so I
guess Tk installation itself is ok.
Someone has experience with getting matplotlib work with Tk?

--- On *Sun, 1/17/10, Erik Tollerud /<erik.tollerud@...287...>/* wrote:

    From: Erik Tollerud <erik.tollerud@...287...>
    Subject: Re: [Matplotlib-users] problem with import pylab
    To: "H L" <hulu800@...9...>
    Date: Sunday, January 17, 2010, 9:18 PM

    Just based on the traceback, the problem seems to be in Tk - does
    anything in tk work for you? (e.g. any of the builtin python gui
    stuff) You might try installing wx and changing your matplotlibrc
    file to have the line "backend:WxAgg" in it. I've never tried using
    the wx backend on windows (anyone done this?), but presumably it
    should work...

    On Fri, Jan 15, 2010 at 5:47 PM, H L <hulu800@...9... > <http://us.mc529.mail.yahoo.com/mc/compose?to=hulu800@...9...&gt;&gt; wrote:

        Hello:
        I am having problem with "import pylab". I attached the
        traceback below. I have googled on the web but haven't found a
        solution. Can someone here help?
        I have ActivePython 2.5, numpy-1.4.0-win32, and
        matplotlib-0.99.1.win32-py2.5.exe, and Windows XP SP3.
        --------------------------------------
        Traceback (most recent call last):
        File "<interactive input>", line 1, in <module>
        File "C:\Python25\lib\site-packages\pylab.py", line 1, in <module>
        from matplotlib.pylab import *
        File "C:\Python25\lib\site-packages\matplotlib\pylab.py", line
        247, in <module>
        from matplotlib.pyplot import *
        File "C:\Python25\lib\site-packages\matplotlib\pyplot.py", line
        78, in <module>
        new_figure_manager, draw_if_interactive, show = pylab_setup()
        File
        "C:\Python25\lib\site-packages\matplotlib\backends\__init__.py",
        line 25, in pylab_setup
        globals(),locals(),[backend_name])
        File
        "C:\Python25\lib\site-packages\matplotlib\backends\backend_tkagg.py",
        line 8, in <module>
        import tkagg # Paint image to Tk photo blitter extension
        File
        "C:\Python25\lib\site-packages\matplotlib\backends\tkagg.py",
        line 1, in <module>
        import _tkagg
        ImportError: DLL load failed: The specified module could not be
        found.
        Thanks.
        HL

        ------------------------------------------------------------------------------
        Throughout its 18-year history, RSA Conference consistently
        attracts the
        world's best and brightest in the field, creating opportunities
        for Conference
        attendees to learn about information security's most important
        issues through
        interactions with peers, luminaries and emerging and established
        companies.
        http://p.sf.net/sfu/rsaconf-dev2dev
        _______________________________________________
        Matplotlib-users mailing list
        Matplotlib-users@lists.sourceforge.net
        <http://us.mc529.mail.yahoo.com/mc/compose?to=Matplotlib-users@lists.sourceforge.net&gt;
        matplotlib-users List Signup and Options

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

The extension _TKAGG.PYD depends on TK84.DLL, TCL84.DLL, MSVCP71.DLL,
and MSVCR71.DLL. Make sure all these files are located in the Windows
search path, e.g. in one of the directories listed in the PATH
environment variable.

Christoph

···

----- Original Message ----
From: Christoph Gohlke <cgohlke@...2143...>
To: H L <hulu800@...9...>
Cc: matplotlib-users@lists.sourceforge.net
Sent: Mon, January 18, 2010 5:04:22 PM
Subject: Re: [Matplotlib-users] problem with import pylab

-------------------------------------------------------------------------------------------------

This is not just a problem on Windows. I have exactly the same problem when trying to use pylab with the SAGE package on my Mac OS X 10.4. I have put up questions on the SAGE support group, but have not gotten any replies. I did some googling and recall that someone on a group a while back said this was a basic problem with matplotlib. I cannot find that message, but the idea was that matplotlib was building only for file saving of graphics, not for interactive. I built my SAGE package from source so that might be right. I have a separate python framework that I use regularly and that has no problems. It's been a long time since I installed it from a binary that I don't remember if I had a problem with it, too. Unfortunately the version is different from SAGE's and I cannot just use the _tkagg module.

My error message:

/Applications/sage/local/lib/python2.6/site-packages/matplotlib/
backends/tkagg.py in <module>()

      2 import Tkinter as Tk
      3
      4 def blit(photoimage, aggimage, bbox=None, colormode=1):
      5 tk = photoimage.tk
      6

ImportError: No module named _tkagg

Anyone have any ideas or pointers?

-- Lou Pecora, my views are my own.

Does anyone know how to fix the tkagg interactive
plotting in matplotlib?

I have a Mac Book Pro, Mac OS X 10.4. I installed SAGE (a symbolic math
package with Python2.6), but got the following error when trying to import
pylab:

/Applications/sage/local/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py
in ()

  6

  7 import Tkinter as Tk, FileDialog

----> 8 import tkagg

Paint image to Tk photo blitter extension

  9 from backend_agg import

FigureCanvasAgg

 10

/Applications/sage/local/lib/python2.6/site-packages/matplotlib/backends/tkagg.py
in ()

  2 import Tkinter as Tk

  3

  4 def blit(photoimage, aggimage,

bbox=None, colormode=1):

  5     tk = photoimage.tk

  6

ImportError: No module named _tkagg

It appears this is matplotlib problem.

Some googling turned up a web discussion where it was
suggested that this is a matplotlib problem, not a SAGE one. The recent thread
“[Matplotlib-users] problem with import pylab” suggests that,
too. I’ve found a few comments
online, but the “fixes” are all for Linux platforms.

Does anyone know how to get TKagg interactive working
on Mac OS X? It appears to revolve
around getting the importable library _tkagg in place. Maybe other things, too.

Thanks for any help or pointers.

– Lou Pecora