networkx fails to install properly for Anaconda 3 (Python version 3.6.2)

859 views
Skip to first unread message

Ivan Savin

unread,
Oct 30, 2017, 3:13:49 PM10/30/17
to networkx-discuss
hello everyone,

I try to install networkx on my computer featuring anaconda 3 (python 3.6.2)

I tried several alternatives like
pip install networkx
pip install networkx [all]
conda install -c anaconda networkx

but in all cases once I start trying to follow your tutorial described here https://networkx.github.io/documentation/stable/tutorial.html
I strat getting errors sth like

TypeError                                 Traceback (most recent call last)
<ipython-input-10-0dd0618a5d65> in <module>()
----> 1 list(G.nodes)
      2 
      3 list(G.edges)
      4 
      5 list(G.adj[1])  # or list(G.neighbors(1))

TypeError: 'method' object is not iterable

when I try to test the correctness of package configuration I get a very long error report (I attach separately)

Could you please recommend how I could deal with that?

I preferably use Jupiter Notebook as I am not advanced in python and this envornment I at least know, but trying Spyder revealed more or less the same problem.

Would be glad to get a swift advice, Ivan Savin

networkx-trial.pdf

Dan Schult

unread,
Oct 30, 2017, 3:27:56 PM10/30/17
to networkx...@googlegroups.com
To make sure you are getting the right version of NetworkX you can use:
>>> import networkx
>>> networkx.__version__

If that is version 1.x for some x then your currently running version of python does not have the latest networkx installed. 
If it is version 2.x then you should be fine and the other errors should go away.

It is quite possible to have more than one version of python and each has its own "site-packages" directory.

There might also be a distinction between "install" and "upgrade/update" and I can't keep it straight between the different package systems.  Make sure it is trying to put in place a version 2.0 or later.

--
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.

Ivan Savin

unread,
Oct 31, 2017, 10:54:59 AM10/31/17
to networkx-discuss
Dear Dan,

thanks for the reply.

Indeed, I discovered thaton my PC I had two versions of Anaconda (2 and 3) and in bith networkx 1.11 and 2.0 installed, but the test you mentioned was showing only 1.11

So I clened the distributive and reinstalled networkx x. Now it shows 2.0
However, runninh nx.test still shows me one error here

======================================================================
ERROR: networkx.tests.test_convert_pandas.TestConvertPandas.test_from_adjacency
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\admin\Anaconda2\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "C:\Users\admin\Anaconda2\lib\site-packages\networkx\tests\test_convert_pandas.py", line 132, in test_from_adjacency
    pd.testing.assert_frame_equal(df, dftrue)
AttributeError: 'module' object has no attribute 'testing'

----------------------------------------------------------------------
Ran 3175 tests in 153.184s

FAILED (SKIP=3, errors=1)

Can you tell me how critical it is and whetehr I could do naything about t?

Thank you again, Ivan
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discu...@googlegroups.com.
To post to this group, send email to networkx...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages