Error importing pylab

Hi all,

I have what seems to be a small error trying to reference a function in the compiled tk backend which doesn’t exist in the shared object (See stack trace below). I’m running on a 64-bit system.

Has anyone else had this issue? Google didn’t reveal a lot to me (searching for “undefined symbol: XCreateIC” exact phrase yielded 2 results, neither very enlightening for me.

python -c import matplotlib; print matplotlib.__version__:

0.99.3

To repeat this error (for me), simply run

python -c ‘import pylab’

Traceback (most recent call last):

File “”, line 1, in

File “/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/pylab.py”, line 1, in

from matplotlib.pylab import *

File “/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/pylab.py”, line 247, in

from matplotlib.pyplot import *

File “/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/pyplot.py”, line 78, in

new_figure_manager, draw_if_interactive, show = pylab_setup()

File “/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/init.py”, line 25, in pylab_setup

globals(),locals(),[backend_name])

File “/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py”, line 8, in

import tkagg # Paint image to Tk photo blitter extension

File “/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/tkagg.py”, line 1, in

import _tkagg

ImportError: /home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/_tkagg.so: undefined symbol: XCreateIC

import tkagg

Output from --verbose:

CONFIGDIR=/home/ho/nmc/tjl/.matplotlib

matplotlib data path /home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/mpl-data

loaded rc file /home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc

matplotlib version 0.99.3

verbose.level helpful

interactive is False

units is False

platform is linux2

Using fontManager instance from /home/ho/nmc/tjl/.matplotlib/fontList.cache

···

Tennessee Leeuwenburg
http://myownhat.blogspot.com/
“Don’t believe everything you think”

Hi all,

I have what seems to be a small error trying to reference a function in
the compiled tk backend which doesn't exist in the shared object (See
stack trace below). I'm running on a 64-bit system.

Has anyone else had this issue? Google didn't reveal a lot to me
(searching for "undefined symbol: XCreateIC" exact phrase yielded 2
results, neither very enlightening for me.

It looks like your tkinter or Tk is not finding xlib; XCreateIC is an xlib routine. There is no direct reference to it in _tkagg.cpp.

What happens if you do

python -c "import Tkinter; root=Tkinter.Tk()"

···

On 06/06/2010 01:40 PM, Tennessee Leeuwenburg wrote:

python -c `import matplotlib; print matplotlib.__version__`:

0.99.3

To repeat this error (for me), simply run
python -c 'import pylab'

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/pylab.py",
line 1, in <module>
     from matplotlib.pylab import *
   File
"/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/pylab.py",
line 247, in <module>
     from matplotlib.pyplot import *
   File
"/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/pyplot.py", line
78, in <module>
     new_figure_manager, draw_if_interactive, show = pylab_setup()
   File
"/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/__init__.py",
line 25, in pylab_setup
     globals(),locals(),[backend_name])
   File
"/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py",
line 8, in <module>
     import tkagg # Paint image to Tk photo blitter
extension
   File
"/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/tkagg.py",
line 1, in <module>
     import _tkagg
ImportError:
/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/_tkagg.so:
undefined symbol: XCreateIC
>>> import tkagg

Output from --verbose:
CONFIGDIR=/home/ho/nmc/tjl/.matplotlib
matplotlib data path
/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/mpl-data
loaded rc file
/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 0.99.3
verbose.level helpful
interactive is False
units is False
platform is linux2
Using fontManager instance from /home/ho/nmc/tjl/.matplotlib/fontList.cache

--
--------------------------------------------------
Tennessee Leeuwenburg
http://myownhat.blogspot.com/
"Don't believe everything you think"

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo

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

Hi Eric,

Thanks for the tip – I didn’t realise that. I had been able to import tkinter, but perhaps only some parts of tkinter exhibit the problem. I worked around the issue by installing matplotlib via rpm since it is only a little behind the curve. It may be that the issue was due to tkagg.so being the ‘last’ object searched, but actually the real problem was more likely to be the lack of some xlib library not being found. In any case, I am happy enough with where I am now :slight_smile:

Thanks for your response,

-Tennessee

···

On Mon, Jun 7, 2010 at 10:37 AM, Eric Firing <efiring@…202…> wrote:

On 06/06/2010 01:40 PM, Tennessee Leeuwenburg wrote:

Hi all,

I have what seems to be a small error trying to reference a function in

the compiled tk backend which doesn’t exist in the shared object (See

stack trace below). I’m running on a 64-bit system.

Has anyone else had this issue? Google didn’t reveal a lot to me

(searching for “undefined symbol: XCreateIC” exact phrase yielded 2

results, neither very enlightening for me.

It looks like your tkinter or Tk is not finding xlib; XCreateIC is an

xlib routine. There is no direct reference to it in _tkagg.cpp.

What happens if you do

python -c “import Tkinter; root=Tkinter.Tk()”

python -c import matplotlib; print matplotlib.__version__:

0.99.3

To repeat this error (for me), simply run

python -c ‘import pylab’

Traceback (most recent call last):

File “”, line 1, in

File “/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/pylab.py”,

line 1, in

 from matplotlib.pylab import *

File

“/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/pylab.py”,

line 247, in

 from matplotlib.pyplot import *

File

“/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/pyplot.py”, line

78, in

 new_figure_manager, draw_if_interactive, show = pylab_setup()

File

“/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/init.py”,

line 25, in pylab_setup

 globals(),locals(),[backend_name])

File

“/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py”,

line 8, in

 import tkagg                 # Paint image to Tk photo blitter

extension

File

“/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/tkagg.py”,

line 1, in

 import _tkagg

ImportError:

/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/backends/_tkagg.so:

undefined symbol: XCreateIC

import tkagg

Output from --verbose:

CONFIGDIR=/home/ho/nmc/tjl/.matplotlib

matplotlib data path

/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/mpl-data

loaded rc file

/home/ho/nmc/tjl/nltk/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc

matplotlib version 0.99.3

verbose.level helpful

interactive is False

units is False

platform is linux2

Using fontManager instance from /home/ho/nmc/tjl/.matplotlib/fontList.cache


Tennessee Leeuwenburg

http://myownhat.blogspot.com/

“Don’t believe everything you think”


ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Tennessee Leeuwenburg
http://myownhat.blogspot.com/
“Don’t believe everything you think”