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>
plt.show()
File "D:\Python254\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 79, in show
Tk.mainloop()
File "D:\Python254\lib\lib-tk\Tkinter.py", line 328, in mainloop
_default_root.tk.mainloop(n)
AttributeError: 'NoneType' object has no attribute 'tk'

whenever I try to call

plt.show()

To use a simple example this occurs when I run

import networkx as nx
import matplotlib.pyplot as plt

G = nx.Graph()

plt.show()

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.

3
Contributors
3
Replies
4
Views
7 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

Warning (from warnings module):
File "C:\Python25\lib\site-packages\matplotlib\numerix\__init__.py", line 18
warnings.warn(msg, DeprecationWarning)
DeprecationWarning:
**********************************************************
matplotlib.numerix and all its subpackages are deprecated.
**********************************************************