Hi I am relatively new to Python so forgive me if I have missed an
elephant in the room so to speak.
My code has worked for the whole day, but this afternoon I have begun receiving the error

Traceback (most recent call last):
  File "C:\Documents and Settings\King Alex\My Documents\Summer Project\Python files\graphs.py", line 7, in <module>
  File "D:\Python254\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 79, in show
  File "D:\Python254\lib\lib-tk\Tkinter.py", line 328, in mainloop
AttributeError: 'NoneType' object has no attribute 'tk'

whenever I try to call


To use a simple example this occurs when I run

import networkx as nx
import matplotlib.pyplot as plt

G = nx.Graph()


Help solving this is very appreciated as it occured without me making a change to my code. During running I was receiving errors from visual c++ about the program terminating unusually.

I am using python 2.5.4 with NumPy, DimPy, Matplotlib and NetworkX. Let me know if any other information would be helpful.

8 Years
Discussion Span
Last Post by Maxim13

If you didn't edit the code, the only thing I could think of is that one of the files being used or imported got changed. But if none of the files necessary to run the program were edited I see no reason that it shouldn't work.


Hi the problem seems to be perhaps with networkx
When I

import networkx as nx

I receive the deprecation warning

Warning (from warnings module):
  File "C:\Python25\lib\site-packages\matplotlib\numerix\__init__.py", line 18
    warnings.warn(msg, DeprecationWarning)
matplotlib.numerix and all its subpackages are deprecated.
They will be removed soon.  Please use numpy instead.

pyplot.show() works fine with normal graphs, and none of the networkx drawing methods work. Any advice on this, even though I can't solve the original mystery of why this has stopped working.


Clibbon, have you solved this problem?
"matplotlib.numerix and all its subpackages are deprecated."

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.