On 03/18/2015 02:27 AM, Chris wrote:
Hi,

I am trying to run NetworkX in Spyder but am unable to get the module
networkx recognised.

I downloaded NetworkX from http://pypi.python.org/pypi/networkx and
installed NetworkX via pip using "pip install networkx". It appeared to
complete OK. When I repeat the command I get

Last login: Wed Mar 18 20:07:35 on ttys000

Fl1cker:~ cbhe$ pip install networkx

Requirement already satisfied (use --upgrade to upgrade): networkx in
/Library/Python/2.7/site-packages/networkx-1.9.1-py2.7.egg

Requirement already satisfied (use --upgrade to upgrade):
decorator>=3.4.0 in
/Library/Python/2.7/site-packages/decorator-3.4.0-py2.7.egg (from networkx)

Fl1cker:~ cbhe$


which suggests to me that it is installed.

However when I try to import network in Spyder using "import networkx as
nx" I get

runfile('Z:/Users/cbhe/scripts/netw0.py', wdir='Z:/Users/cbhe/scripts')
Traceback (most recent call last):

   File "<ipython-input-2-5455c9a69031>", line 1, in <module>
     runfile('Z:/Users/cbhe/scripts/netw0.py', wdir='Z:/Users/cbhe/scripts')

   File
"C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 601, in runfile
     execfile(filename, namespace)

   File
"C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 66, in execfile
     exec(compile(scripttext, filename, 'exec'), glob, loc)

   File "Z:/Users/cbhe/scripts/netw0.py", line 1, in <module>
     import networkx as nx

ImportError: No module named 
http://www.postgresql.org/docs/9.3/interactive/app-pgbasebackup.html

I can only think that it is a Python Path issue, but I have tried
numerous paths that all produce the same result.

Any suggestions would be really welcome as I am being held up by this
problem.

Some information is needed I think.

1) Your pip install lines look they where done on a Unix* machine, but the traceback looks like it comes from a Windows machine.
Could you explain your layout some?

2) What version of Spyder and how was it installed?

3) Can you open a Python interpreter and import networkx?






--
Adrian Klaver
adrian.kla...@aklaver.com

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

Reply via email to