problem graphing networkx with matplotlib (windows 64)

33 views
Skip to first unread message

Colin Wilder

unread,
Oct 15, 2017, 9:28:33 AM10/15/17
to networkx-discuss
Hi folks,
I'm running networkx in Python 2.7 in Windows 64 bit. I've successfully installed networkx but get errors when I try to draw a graph, as follows:

import networkx as nx
G
= nx.Graph()
G
.add_edge("jus","civilis")
print(G.nodes())
print(G.edges())
# works so far
import matplotlib.pyplot as plt # according to the networkx.github.io tutorial, this is the first step for drawing a graph

I get the following output (running in Komodo Edit, but similar in iPython):

['jus', 'civilis']
[('jus', 'civilis')]
Traceback (most recent call last):
 
File "sandbox_mxpgv.py", line 9, in <module>
   
import matplotlib.pylab as plt
 
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 124, in <module>
   
from . import cbook
 
File "C:\Python27\lib\site-packages\matplotlib\cbook\__init__.py", line 35, in <module>
   
import numpy as np
 
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 142, in <module>
   
from . import add_newdocs
 
File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
   
from numpy.lib import add_newdoc
 
File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
   
from .type_check import *
 
File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
   
import numpy.core.numeric as _nx
 
File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 14, in <module>
   
from . import multiarray
ImportError: DLL load failed: %1 is not a valid Win32 application.

Can anyone help?

Thanks!

Colin


Dmitry Zinoviev

unread,
Oct 15, 2017, 11:48:42 AM10/15/17
to networkx...@googlegroups.com
Your OS and various Python libraries do not match. Some of them are 32 bit, some 64 bit. You may get a more specific answer on StackOverflow - for example, here: https://stackoverflow.com/questions/19019720/importerror-dll-load-failed-1-is-not-a-valid-win32-application-but-the-dlls and https://stackoverflow.com/questions/4676433/solving-dll-load-failed-1-is-not-a-valid-win32-application-for-pygame

--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to networkx-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/networkx-discuss.
For more options, visit https://groups.google.com/d/optout.



--
Dmitry Zinoviev, Author of "Data Science Essentials in Python" 
https://pragprog.com/book/dzpyds/data-science-essentials-in-python
Professor of Computer Science, Suffolk University, Boston, MA 02114
Reply all
Reply to author
Forward
0 new messages